home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / backup / tktbacku.tar / tktbackup.tar / tktbackup-dist / tktbackup < prev    next >
Text File  |  1994-08-11  |  111KB  |  3,244 lines

  1. #!/usr/local/bin/wish -f
  2. # Program: tktbackup
  3. # Tcl version: 7.3 (Tcl/Tk/XF)
  4. # Tk version: 3.6
  5. # XF version: 2.3
  6. #
  7.  
  8. # module inclusion
  9.  
  10. global env
  11. global xfLoadPath
  12. global xfLoadInfo
  13. set xfLoadInfo 0
  14. if {[info exists env(XF_LOAD_PATH)]} {
  15.   if {[string first $env(XF_LOAD_PATH) /usr/local/lib/] == -1} {
  16.     set xfLoadPath $env(XF_LOAD_PATH):/usr/local/lib/
  17.   } {
  18.     set xfLoadPath /usr/local/lib/
  19.   }
  20. } {
  21.   set xfLoadPath /usr/local/lib/
  22. }
  23.  
  24. global argc
  25. global argv
  26. global tkVersion
  27. set tmpArgv ""
  28. for {set counter 0} {$counter < $argc} {incr counter 1} {
  29.   case [string tolower [lindex $argv $counter]] in {
  30.     {-xfloadpath} {
  31.       incr counter 1
  32.       set xfLoadPath "[lindex $argv $counter]:$xfLoadPath"
  33.     }
  34.     {-xfstartup} {
  35.       incr counter 1
  36.       source [lindex $argv $counter]
  37.     }
  38.     {-xfbindfile} {
  39.       incr counter 1
  40.       set env(XF_BIND_FILE) "[lindex $argv $counter]"
  41.     }
  42.     {-xfcolorfile} {
  43.       incr counter 1
  44.       set env(XF_COLOR_FILE) "[lindex $argv $counter]"
  45.     }
  46.     {-xfcursorfile} {
  47.       incr counter 1
  48.       set env(XF_CURSOR_FILE) "[lindex $argv $counter]"
  49.     }
  50.     {-xffontfile} {
  51.       incr counter 1
  52.       set env(XF_FONT_FILE) "[lindex $argv $counter]"
  53.     }
  54.     {-xfmodelmono} {
  55.       if {$tkVersion >= 3.0} {
  56.         tk colormodel . monochrome
  57.       }
  58.     }
  59.     {-xfmodelcolor} {
  60.       if {$tkVersion >= 3.0} {
  61.         tk colormodel . color
  62.       }
  63.     }
  64.     {-xfloading} {
  65.       set xfLoadInfo 1
  66.     }
  67.     {-xfnoloading} {
  68.       set xfLoadInfo 0
  69.     }
  70.     {default} {
  71.       lappend tmpArgv [lindex $argv $counter]
  72.     }
  73.   }
  74. }
  75. set argv $tmpArgv
  76. set argc [llength $tmpArgv]
  77. unset counter
  78. unset tmpArgv
  79.  
  80.  
  81. # procedure to show window ShowWindow.aboutBox
  82. proc ShowWindow.aboutBox { args} {
  83. # xf ignore me 7
  84.  
  85.   # build widget .aboutBox
  86.   if {"[info procs XFEdit]" != ""} {
  87.     catch "XFDestroy .aboutBox"
  88.   } {
  89.     catch "destroy .aboutBox"
  90.   }
  91.   toplevel .aboutBox   -background {#bfbfbf}  -relief {raised}
  92.  
  93.   # Window manager configurations
  94.   global tkVersion
  95.   wm positionfrom .aboutBox program
  96.   wm sizefrom .aboutBox program
  97.   wm geometry .aboutBox 366x154+132+147
  98.   wm title .aboutBox {About tktbackup!}
  99.  
  100.  
  101.   # build widget .aboutBox.aboutTktbackup
  102.   message .aboutBox.aboutTktbackup  -aspect {1439}  -background {#bfbfbf}  -padx {5}  -pady {2}  -text {            TkTbackup!
  103. (c)1994 jon madison.
  104.  
  105. bug reports, comments to:
  106.      jonboy@neuromancer.ucr.edu
  107.  
  108. TkTbackup home page at:
  109. http://indyunix.iupui.edu/~jmmadiso/tktbackup.html}
  110.  
  111.   # build widget .aboutBox.okButton
  112.   button .aboutBox.okButton  -activebackground {#bfbfbf}  -background {#bfbfbf}  -command {grab release .aboutBox ; DestroyWindow.aboutBox}  -state {active}  -text {Okey}  -width {213}
  113.  
  114.   # pack widget .aboutBox
  115.   pack append .aboutBox  .aboutBox.aboutTktbackup {top frame center pady 13 expand}  .aboutBox.okButton {top frame center expand}
  116.  
  117.   if {"[info procs XFEdit]" != ""} {
  118.     catch "XFMiscBindWidgetTree .aboutBox"
  119.     after 2 "catch {XFEditSetShowWindows}"
  120.   }
  121. }
  122.  
  123. proc DestroyWindow.aboutBox {} {# xf ignore me 7
  124.   if {"[info procs XFEdit]" != ""} {
  125.     if {"[info commands .aboutBox]" != ""} {
  126.       global xfShowWindow.aboutBox
  127.       set xfShowWindow.aboutBox 0
  128.       XFEditSetPath .
  129.       after 2 "XFSaveAsProc .aboutBox; XFEditSetShowWindows"
  130.     }
  131.   } {
  132.     catch "destroy .aboutBox"
  133.     update
  134.   }
  135. }
  136.  
  137.  
  138. # procedure to show window ShowWindow.filedescriptionwindow
  139. proc ShowWindow.filedescriptionwindow { args} {
  140. # xf ignore me 7
  141.  
  142.   # build widget .filedescriptionwindow
  143.   if {"[info procs XFEdit]" != ""} {
  144.     catch "XFDestroy .filedescriptionwindow"
  145.   } {
  146.     catch "destroy .filedescriptionwindow"
  147.   }
  148.   toplevel .filedescriptionwindow   -background {#bfbfbf}  -borderwidth {3}
  149.  
  150.   # Window manager configurations
  151.   global tkVersion
  152.   wm positionfrom .filedescriptionwindow program
  153.   wm sizefrom .filedescriptionwindow program
  154.   wm geometry .filedescriptionwindow 272x349+139+85
  155.   wm maxsize .filedescriptionwindow 470 412
  156.   wm minsize .filedescriptionwindow 10 10
  157.   wm title .filedescriptionwindow {Backup Description    }
  158.  
  159.  
  160.   # build widget .filedescriptionwindow.okey
  161.   button .filedescriptionwindow.okey  -activebackground {#bfbfbf}  -background {#bfbfbf}  -command {DestroyWindow.filedescriptionwindow}  -font {-Adobe-Helvetica-medium-r-*-*-18-*-*-*-*-*-*-*}  -state {active}  -text {okey}
  162.  
  163.   # build widget .filedescriptionwindow.backupdescription
  164.   text .filedescriptionwindow.backupdescription  -background {#9100b3749f32}  -borderwidth {4}  -relief {sunken}  -wrap {none}
  165.  
  166.   # pack widget .filedescriptionwindow
  167.   pack append .filedescriptionwindow  .filedescriptionwindow.okey {bottom frame center fillx}  .filedescriptionwindow.backupdescription {bottom frame center fillx}
  168.  
  169.   .filedescriptionwindow.backupdescription insert end {}
  170.  
  171.  
  172.  
  173.   if {"[info procs XFEdit]" != ""} {
  174.     catch "XFMiscBindWidgetTree .filedescriptionwindow"
  175.     after 2 "catch {XFEditSetShowWindows}"
  176.   }
  177. }
  178.  
  179. proc DestroyWindow.filedescriptionwindow {} {# xf ignore me 7
  180.   if {"[info procs XFEdit]" != ""} {
  181.     if {"[info commands .filedescriptionwindow]" != ""} {
  182.       global xfShowWindow.filedescriptionwindow
  183.       set xfShowWindow.filedescriptionwindow 0
  184.       XFEditSetPath .
  185.       after 2 "XFSaveAsProc .filedescriptionwindow; XFEditSetShowWindows"
  186.     }
  187.   } {
  188.     catch "destroy .filedescriptionwindow"
  189.     update
  190.   }
  191. }
  192.  
  193.  
  194. # procedure to show window .
  195. proc ShowWindow. {args} {# xf ignore me 7
  196.  
  197.   # Window manager configurations
  198.   global tkVersion
  199.   wm positionfrom . user
  200.   wm sizefrom . program
  201.   wm geometry . 639x471
  202.   wm maxsize . 639 482
  203.   wm minsize . 338 454
  204.   wm title . {tktbackup}
  205.  
  206.   # bindings
  207.   bind . <Button-3> {MenuPopupPost .menu5 %X %Y}
  208.   bind . <ButtonRelease-3> {MenuPopupRelease .menu5 %W}
  209.  
  210.   # build widget .topmenubar
  211.   frame .topmenubar \
  212.     -background {#a75ec168c312} \
  213.     -borderwidth {2} \
  214.     -relief {raised}
  215.  
  216.   # build widget .topmenubar.menubutton1
  217.   menubutton .topmenubar.menubutton1 \
  218.     -activebackground {#a75ec168c312} \
  219.     -background {#a75ec168c312} \
  220.     -disabledforeground {#778d778d778d} \
  221.     -menu {.topmenubar.menubutton1.m} \
  222.     -text {File} \
  223.     -underline {0}
  224.  
  225.   # build widget .topmenubar.menubutton1.m
  226.   menu .topmenubar.menubutton1.m \
  227.     -activebackground {#a75ec168c312} \
  228.     -background {#a75ec168c312} \
  229.     -disabledforeground {#778d778d778d}
  230.   .topmenubar.menubutton1.m add command \
  231.     -command {foo} \
  232.     -label {Load Config file...} \
  233.     -state {disabled} \
  234.     -underline {0}
  235.   .topmenubar.menubutton1.m add command \
  236.     -command {exit} \
  237.     -label {Save Config} \
  238.     -state {disabled} \
  239.     -underline {0}
  240.   .topmenubar.menubutton1.m add command \
  241.     -command {set temp [FSBox "save to *.arg file:" "$fsBox(path)/$fsBox(name)"] 
  242. if {[string length $temp] !=0 } {
  243. set argfilename $temp
  244. WriteVars $argfilename} } \
  245.     -label {Save Config As} \
  246.     -underline {1}
  247.   .topmenubar.menubutton1.m add separator
  248.   .topmenubar.menubutton1.m add command \
  249.     -command {ShowWindow.aboutBox;
  250. grab aboutBox} \
  251.     -label {About tktbackup} \
  252.     -underline {6}
  253.   .topmenubar.menubutton1.m add command \
  254.     -command {catch [exec rm -f /tmp/.tktbackup.set] ; 
  255. .chooseMethodFrame.onemethodframe.enterdirset delete 0 end;
  256. exit} \
  257.     -label {Exit} \
  258.     -underline {1}
  259.  
  260.   # build widget .topmenubar.menubutton2
  261.   menubutton .topmenubar.menubutton2 \
  262.     -activebackground {#a75ec168c312} \
  263.     -background {#a75ec168c312} \
  264.     -menu {.topmenubar.menubutton2.m} \
  265.     -text {Help} \
  266.     -underline {0}
  267.  
  268.   # build widget .topmenubar.menubutton2.m
  269.   menu .topmenubar.menubutton2.m \
  270.     -activebackground {#a75ec168c312} \
  271.     -background {#a75ec168c312}
  272.   .topmenubar.menubutton2.m add command \
  273.     -label {tbackup options...}
  274.   .topmenubar.menubutton2.m add command \
  275.     -command {ShowWindow.aboutBox ; grab .aboutBox} \
  276.     -label {About} \
  277.     -state {active}
  278.  
  279.   # build widget .topmenubar.actionmenu
  280.   menubutton .topmenubar.actionmenu \
  281.     -activebackground {#a75ec168c312} \
  282.     -background {#a75ec168c312} \
  283.     -menu {.topmenubar.actionmenu.m} \
  284.     -text {Actions} \
  285.     -underline {1}
  286.  
  287.   # build widget .topmenubar.actionmenu.m
  288.   menu .topmenubar.actionmenu.m \
  289.     -activebackground {#a75ec168c312} \
  290.     -background {#a75ec168c312}
  291.   .topmenubar.actionmenu.m add command \
  292.     -command {exec xterm -e tbackup -[file tail [file root $argfilename]] } \
  293.     -label {run tbackup} \
  294.     -underline {0}
  295.  
  296.   # pack widget .topmenubar
  297.   pack append .topmenubar \
  298.     .topmenubar.menubutton1 {left frame center} \
  299.     .topmenubar.menubutton2 {right frame center} \
  300.     .topmenubar.actionmenu {left frame center}
  301.  
  302.   # build widget .backuptypeframe
  303.   frame .backuptypeframe \
  304.     -background {#6dabd0e5c927} \
  305.     -borderwidth {2} \
  306.     -cursor {hand1} \
  307.     -relief {ridge}
  308.  
  309.   # build widget .backuptypeframe.label3
  310.   label .backuptypeframe.label3 \
  311.     -background {#6dabd0e5c927} \
  312.     -font {-Adobe-Helvetica-Bold-R-*-*-14-*-*-*-*-*-*-*} \
  313.     -text {level:  }
  314.  
  315.   # build widget .backuptypeframe.full
  316.   radiobutton .backuptypeframe.full \
  317.     -activebackground {#64566bc666bc} \
  318.     -activeforeground {#e35ae5a19e72} \
  319.     -background {#6dabd0e5c927} \
  320.     -command {ForgetWindow .backuptypeframe.text1;
  321. ForgetWindow .backuptypeframe.text2;
  322. pack .backuptypeframe.text0 -side bottom -anchor w} \
  323.     -relief {ridge} \
  324.     -text {f} \
  325.     -value {f} \
  326.     -variable {level}
  327.  
  328.   # build widget .backuptypeframe.incOnFull
  329.   radiobutton .backuptypeframe.incOnFull \
  330.     -activebackground {#64566bc666bc} \
  331.     -activeforeground {#e35ae5a19e72} \
  332.     -background {#6dabd0e5c927} \
  333.     -command {ForgetWindow .backuptypeframe.text0;
  334. ForgetWindow .backuptypeframe.text2;
  335. pack .backuptypeframe.text1 -side bottom -anchor w} \
  336.     -relief {ridge} \
  337.     -text {if} \
  338.     -value {if    } \
  339.     -variable {level}
  340.  
  341.   # build widget .backuptypeframe.incOnInc
  342.   radiobutton .backuptypeframe.incOnInc \
  343.     -activebackground {#64566bc666bc} \
  344.     -activeforeground {#e35ae5a19e72} \
  345.     -background {#6dabd0e5c927} \
  346.     -command {ForgetWindow .backuptypeframe.text0;
  347. ForgetWindow .backuptypeframe.text1; 
  348. pack .backuptypeframe.text2 -side bottom -anchor w} \
  349.     -relief {ridge} \
  350.     -text {ii} \
  351.     -value {ii} \
  352.     -variable {level}
  353.  
  354.   # build widget .backuptypeframe.text0
  355.   text .backuptypeframe.text0 \
  356.     -background {#6dabd0e5c927} \
  357.     -font {-*-utopia-medium-r-*-*-16-*-*-*-*-*-*-*} \
  358.     -height {1} \
  359.     -relief {raised} \
  360.     -wrap {none}
  361.   # bindings
  362.   bind .backuptypeframe.text0 <Any-Key> {{NoFunction}}
  363.  
  364.   # build widget .backuptypeframe.text1
  365.   text .backuptypeframe.text1 \
  366.     -background {#6dabd0e5c927} \
  367.     -font {-*-utopia-medium-r-*-*-16-*-*-*-*-*-*-*} \
  368.     -height {1} \
  369.     -relief {raised} \
  370.     -wrap {none}
  371.   # bindings
  372.   bind .backuptypeframe.text1 <Any-Key> {{NoFunction}}
  373.  
  374.   # build widget .backuptypeframe.text2
  375.   text .backuptypeframe.text2 \
  376.     -background {#6dabd0e5c927} \
  377.     -font {-*-utopia-medium-r-*-*-16-*-*-*-*-*-*-*} \
  378.     -height {1} \
  379.     -relief {raised} \
  380.     -wrap {none}
  381.   # bindings
  382.   bind .backuptypeframe.text2 <Any-Key> {{NoFunction}}
  383.  
  384.   # pack widget .backuptypeframe
  385.   pack append .backuptypeframe \
  386.     .backuptypeframe.label3 {left frame nw fillx} \
  387.     .backuptypeframe.full {left frame nw} \
  388.     .backuptypeframe.incOnFull {left frame nw} \
  389.     .backuptypeframe.incOnInc {left frame nw} \
  390.     .backuptypeframe.text0 {bottom frame w}
  391.  
  392.   # build widget .chooseMethodFrame
  393.   frame .chooseMethodFrame \
  394.     -background {#bfbfbf} \
  395.     -borderwidth {1} \
  396.     -geometry {37x213} \
  397.     -relief {sunken}
  398.  
  399.   # build widget .chooseMethodFrame.frame
  400.   frame .chooseMethodFrame.frame \
  401.     -background {#b045bef9b801} \
  402.     -borderwidth {3} \
  403.     -relief {groove}
  404.  
  405.   # build widget .chooseMethodFrame.frame.scrollbar2
  406.   scrollbar .chooseMethodFrame.frame.scrollbar2 \
  407.     -activeforeground {White} \
  408.     -background {#b045bef9b801} \
  409.     -command {.chooseMethodFrame.frame.listbox1 yview} \
  410.     -foreground {#b045bef9b801} \
  411.     -relief {sunken}
  412.  
  413.   # build widget .chooseMethodFrame.frame.frame
  414.   frame .chooseMethodFrame.frame.frame \
  415.     -background {#b045bef9b801}
  416.  
  417.   # build widget .chooseMethodFrame.frame.frame.scrollbar3
  418.   scrollbar .chooseMethodFrame.frame.frame.scrollbar3 \
  419.     -activeforeground {White} \
  420.     -background {#b045bef9b801} \
  421.     -command {.chooseMethodFrame.frame.listbox1 xview} \
  422.     -foreground {#b045bef9b801} \
  423.     -orient {horizontal} \
  424.     -relief {sunken}
  425.  
  426.   # build widget .chooseMethodFrame.frame.frame.frame
  427.   frame .chooseMethodFrame.frame.frame.frame \
  428.     -background {#b045bef9b801} \
  429.     -geometry {19x19}
  430.  
  431.   # pack widget .chooseMethodFrame.frame.frame
  432.   pack append .chooseMethodFrame.frame.frame \
  433.     .chooseMethodFrame.frame.frame.scrollbar3 {left frame center pady 8 expand fillx} \
  434.     .chooseMethodFrame.frame.frame.frame {left frame center padx 8}
  435.  
  436.   # build widget .chooseMethodFrame.frame.label1
  437.   label .chooseMethodFrame.frame.label1 \
  438.     -background {#b045bef9b801} \
  439.     -font {-*-helvetica-medium-r-normal-*-12-*-*-*-p-*-iso8859-1} \
  440.     -foreground {#000000} \
  441.     -relief {ridge} \
  442.     -text {use backup set:} \
  443.     -width {28}
  444.  
  445.   # build widget .chooseMethodFrame.frame.listbox1
  446.   listbox .chooseMethodFrame.frame.listbox1 \
  447.     -background {#b045bef9b801} \
  448.     -font {*-Courier-Medium-R-Normal--*-120-*} \
  449.     -foreground {#000000} \
  450.     -geometry {14x5} \
  451.     -relief {sunken} \
  452.     -xscrollcommand {.chooseMethodFrame.frame.frame.scrollbar3 set} \
  453.     -yscrollcommand {.chooseMethodFrame.frame.scrollbar2 set}
  454.   # bindings
  455.   bind .chooseMethodFrame.frame.listbox1 <B1-Motion> {%W select from [%W nearest %y]}
  456.   bind .chooseMethodFrame.frame.listbox1 <Button-1> {%W select from [%W nearest %y]}
  457.   bind .chooseMethodFrame.frame.listbox1 <ButtonRelease-1> {set setnameselection [selection get]}
  458.   bind .chooseMethodFrame.frame.listbox1 <Shift-B1-Motion> {%W select from [%W nearest %y]}
  459.   bind .chooseMethodFrame.frame.listbox1 <Shift-Button-1> {%W select from [%W nearest %y]}
  460.  
  461.   # pack widget .chooseMethodFrame.frame
  462.   pack append .chooseMethodFrame.frame \
  463.     .chooseMethodFrame.frame.label1 {top frame center padx 47 fillx} \
  464.     .chooseMethodFrame.frame.frame {bottom frame center fillx} \
  465.     .chooseMethodFrame.frame.scrollbar2 {right frame center padx 8 filly} \
  466.     .chooseMethodFrame.frame.listbox1 {top frame center expand fill}
  467.  
  468.   # build widget .chooseMethodFrame.chooseMethodButtonsFrame
  469.   frame .chooseMethodFrame.chooseMethodButtonsFrame \
  470.     -background {#bfbfbf} \
  471.     -borderwidth {4}
  472.  
  473.   # build widget .chooseMethodFrame.chooseMethodButtonsFrame.label3
  474.   label .chooseMethodFrame.chooseMethodButtonsFrame.label3 \
  475.     -background {#c964af82d3f7} \
  476.     -font {-Adobe-Helvetica-Bold-R-*-*-14-*-*-*-*-*-*-*} \
  477.     -relief {raised} \
  478.     -text {Choose Method.}
  479.  
  480.   # build widget .chooseMethodFrame.chooseMethodButtonsFrame.set
  481.   radiobutton .chooseMethodFrame.chooseMethodButtonsFrame.set \
  482.     -activebackground {#8c0495e9aac0} \
  483.     -background {#bfbfbf} \
  484.     -borderwidth {1} \
  485.     -command {pack  .chooseMethodFrame.frame -side right -fill y -anchor nw   ;
  486.  pack .chooseMethodFrame.rescansetlistbutton   -side bottom -anchor s -expand 1; 
  487.  ForgetWindow  .chooseMethodFrame.onehelpframe .chooseMethodFrame.setRMhelpframe  .chooseMethodFrame.onemethodframe ;
  488.  pack .chooseMethodFrame.sethelpframe  -side left -anchor ne ;
  489.  FileInList .chooseMethodFrame.frame.listbox1 $setfiled} \
  490.     -text {set} \
  491.     -value {set} \
  492.     -variable {choosemethod}
  493.  
  494.   # build widget .chooseMethodFrame.chooseMethodButtonsFrame.setrm
  495.   radiobutton .chooseMethodFrame.chooseMethodButtonsFrame.setrm \
  496.     -activebackground {#8c0495e9aac0} \
  497.     -background {#bfbfbf} \
  498.     -borderwidth {1} \
  499.     -command {pack  .chooseMethodFrame.frame -side right  -fill y -anchor nw;
  500.  pack .chooseMethodFrame.rescansetlistbutton  -side bottom -anchor s -expand 1;
  501.  ForgetWindow .chooseMethodFrame.sethelpframe .chooseMethodFrame.onehelpframe .chooseMethodFrame.onemethodframe ; 
  502.  pack .chooseMethodFrame.setRMhelpframe  -side left -anchor ne ; FileInList .chooseMethodFrame.frame.listbox1 $setfiled} \
  503.     -text {setrm} \
  504.     -value {setrm} \
  505.     -variable {choosemethod}
  506.  
  507.   # build widget .chooseMethodFrame.chooseMethodButtonsFrame.one
  508.   radiobutton .chooseMethodFrame.chooseMethodButtonsFrame.one \
  509.     -activebackground {#8c0495e9aac0} \
  510.     -background {#bfbfbf} \
  511.     -borderwidth {1} \
  512.     -command {ForgetWindow .chooseMethodFrame.frame  .chooseMethodFrame.sethelpframe .chooseMethodFrame.setRMhelpframe  .chooseMethodFrame.rescansetlistbutton ;
  513. pack .chooseMethodFrame.onehelpframe -side top -anchor c ; 
  514. pack .chooseMethodFrame.onemethodframe -side top -anchor w} \
  515.     -text {one} \
  516.     -value {one} \
  517.     -variable {choosemethod}
  518.  
  519.   # pack widget .chooseMethodFrame.chooseMethodButtonsFrame
  520.   pack append .chooseMethodFrame.chooseMethodButtonsFrame \
  521.     .chooseMethodFrame.chooseMethodButtonsFrame.label3 {top frame n padx 20 fill} \
  522.     .chooseMethodFrame.chooseMethodButtonsFrame.set {top frame n expand fill} \
  523.     .chooseMethodFrame.chooseMethodButtonsFrame.setrm {top frame n expand fill} \
  524.     .chooseMethodFrame.chooseMethodButtonsFrame.one {top frame n expand fill}
  525.  
  526.   # build widget .chooseMethodFrame.sethelpframe
  527.   frame .chooseMethodFrame.sethelpframe \
  528.     -background {#bfbfbf} \
  529.     -borderwidth {2}
  530.  
  531.   # build widget .chooseMethodFrame.sethelpframe.text1
  532.   text .chooseMethodFrame.sethelpframe.text1 \
  533.     -background {#bfbfbf} \
  534.     -borderwidth {6} \
  535.     -font {*-times-medium-r-*-*-14-*} \
  536.     -height {2} \
  537.     -width {28} \
  538.     -wrap {none}
  539.   # bindings
  540.   bind .chooseMethodFrame.sethelpframe.text1 <Any-Key> {NoFunction}
  541.  
  542.   # pack widget .chooseMethodFrame.sethelpframe
  543.   pack append .chooseMethodFrame.sethelpframe \
  544.     .chooseMethodFrame.sethelpframe.text1 {top frame n fillx}
  545.  
  546.   # build widget .chooseMethodFrame.setRMhelpframe
  547.   frame .chooseMethodFrame.setRMhelpframe \
  548.     -background {#bfbfbf} \
  549.     -borderwidth {2}
  550.  
  551.   # build widget .chooseMethodFrame.setRMhelpframe.text1
  552.   text .chooseMethodFrame.setRMhelpframe.text1 \
  553.     -background {#bfbfbf} \
  554.     -borderwidth {8} \
  555.     -font {*-times-medium-r-*-*-14-*-*-*-*-*-*-*} \
  556.     -height {3} \
  557.     -width {28} \
  558.     -wrap {none}
  559.   # bindings
  560.   bind .chooseMethodFrame.setRMhelpframe.text1 <Any-Key> {NoFunction}
  561.  
  562.   # pack widget .chooseMethodFrame.setRMhelpframe
  563.   pack append .chooseMethodFrame.setRMhelpframe \
  564.     .chooseMethodFrame.setRMhelpframe.text1 {top frame center fill}
  565.  
  566.   # build widget .chooseMethodFrame.onehelpframe
  567.   frame .chooseMethodFrame.onehelpframe \
  568.     -background {#bfbfbf} \
  569.     -borderwidth {2}
  570.  
  571.   # build widget .chooseMethodFrame.onehelpframe.text1
  572.   text .chooseMethodFrame.onehelpframe.text1 \
  573.     -background {#bfbfbf} \
  574.     -borderwidth {8} \
  575.     -font {*-times-medium-r-*-*-14-*-*-*-*-*-*-*} \
  576.     -height {2} \
  577.     -width {30} \
  578.     -wrap {none}
  579.   # bindings
  580.   bind .chooseMethodFrame.onehelpframe.text1 <Any-Key> {NoFunction}
  581.  
  582.   # pack widget .chooseMethodFrame.onehelpframe
  583.   pack append .chooseMethodFrame.onehelpframe \
  584.     .chooseMethodFrame.onehelpframe.text1 {top frame nw padx 200 expand}
  585.  
  586.   # build widget .chooseMethodFrame.rescansetlistbutton
  587.   button .chooseMethodFrame.rescansetlistbutton \
  588.     -activebackground {#afafaf} \
  589.     -background {#b232c51eb621} \
  590.     -borderwidth {3} \
  591.     -command {opensetfilelist /tmp/.tktbackup.set;
  592. .chooseMethodFrame.frame.listbox1 delete 0 end ;
  593. FileInList .chooseMethodFrame.frame.listbox1 /tmp/.tktbackup.set} \
  594.     -height {4} \
  595.     -text {Rescan Set List}
  596.  
  597.   # build widget .chooseMethodFrame.onemethodframe
  598.   frame .chooseMethodFrame.onemethodframe \
  599.     -background {#bfbfbf} \
  600.     -borderwidth {2}
  601.  
  602.   # build widget .chooseMethodFrame.onemethodframe.scrollbar0
  603.   scrollbar .chooseMethodFrame.onemethodframe.scrollbar0 \
  604.     -background {#bfbfbf} \
  605.     -command {.chooseMethodFrame.onemethodframe.enterdirset view} \
  606.     -foreground {#bfbfbf} \
  607.     -orient {horizontal} \
  608.     -relief {sunken} \
  609.     -width {11}
  610.  
  611.   # build widget .chooseMethodFrame.onemethodframe.enterdirset
  612.   entry .chooseMethodFrame.onemethodframe.enterdirset \
  613.     -background {#b0e6cfdebadf} \
  614.     -font {-*-courier-bold-r-normal-*-15-*-*-*-*-*-*-*} \
  615.     -relief {sunken} \
  616.     -scrollcommand {.chooseMethodFrame.onemethodframe.scrollbar0 set} \
  617.     -width {35}
  618.  
  619.   # pack widget .chooseMethodFrame.onemethodframe
  620.   pack append .chooseMethodFrame.onemethodframe \
  621.     .chooseMethodFrame.onemethodframe.enterdirset {top frame center} \
  622.     .chooseMethodFrame.onemethodframe.scrollbar0 {bottom frame center fillx}
  623.  
  624.   # pack widget .chooseMethodFrame
  625.   pack append .chooseMethodFrame \
  626.     .chooseMethodFrame.chooseMethodButtonsFrame {left frame w pady 79 expand filly} \
  627.     .chooseMethodFrame.frame {right frame nw filly} \
  628.     .chooseMethodFrame.rescansetlistbutton {bottom frame s expand} \
  629.     .chooseMethodFrame.sethelpframe {left frame ne}
  630.  
  631.   # build widget .packMethodsFrame
  632.   frame .packMethodsFrame \
  633.     -background {#6dabd0e5c927} \
  634.     -borderwidth {3} \
  635.     -cursor {hand1} \
  636.     -geometry {30x74} \
  637.     -relief {ridge}
  638.  
  639.   # build widget .packMethodsFrame.label3
  640.   label .packMethodsFrame.label3 \
  641.     -background {#6dabd0e5c927} \
  642.     -font {-Adobe-Helvetica-Bold-R-*-*-14-*-*-*-*-*-*-*} \
  643.     -text {pack methods-> }
  644.  
  645.   # build widget .packMethodsFrame.afio
  646.   radiobutton .packMethodsFrame.afio \
  647.     -activebackground {#64566bc666bc} \
  648.     -activeforeground {#e35ae5a19e72} \
  649.     -background {#6dabd0e5c927} \
  650.     -command {ForgetWindow .packMethodsFrame.text1 .packMethodsFrame.text7 .packMethodsFrame.text8 ; pack .packMethodsFrame.text0 -side bottom -anchor w} \
  651.     -relief {ridge} \
  652.     -text {afio} \
  653.     -value {afio} \
  654.     -variable {packmethod}
  655.  
  656.   # build widget .packMethodsFrame.afio0
  657.   radiobutton .packMethodsFrame.afio0 \
  658.     -activebackground {#64566bc666bc} \
  659.     -activeforeground {#e35ae5a19e72} \
  660.     -background {#6dabd0e5c927} \
  661.     -command {ForgetWindow .packMethodsFrame.text0 .packMethodsFrame.text7 .packMethodsFrame.text8 ;  pack .packMethodsFrame.text1 -side bottom -anchor w} \
  662.     -relief {ridge} \
  663.     -text {afio0} \
  664.     -value {afio0    } \
  665.     -variable {packmethod}
  666.  
  667.   # build widget .packMethodsFrame.tar
  668.   radiobutton .packMethodsFrame.tar \
  669.     -activebackground {#64566bc666bc} \
  670.     -activeforeground {#e35ae5a19e72} \
  671.     -background {#6dabd0e5c927} \
  672.     -command {ForgetWindow .packMethodsFrame.text0 .packMethodsFrame.text1 .packMethodsFrame.text8; pack .packMethodsFrame.text7 -side bottom -anchor w} \
  673.     -relief {ridge} \
  674.     -text {tar} \
  675.     -value {tar} \
  676.     -variable {packmethod}
  677.  
  678.   # build widget .packMethodsFrame.tarcpio
  679.   radiobutton .packMethodsFrame.tarcpio \
  680.     -activebackground {#64566bc666bc} \
  681.     -activeforeground {#e35ae5a19e72} \
  682.     -background {#6dabd0e5c927} \
  683.     -command {ForgetWindow .packMethodsFrame.text0 .packMethodsFrame.text1  .packMethodsFrame.text7 ; pack .packMethodsFrame.text8 -side bottom -anchor w} \
  684.     -relief {ridge} \
  685.     -text {tarcpio} \
  686.     -value {tarcpio} \
  687.     -variable {packmethod}
  688.  
  689.   # build widget .packMethodsFrame.text0
  690.   text .packMethodsFrame.text0 \
  691.     -background {#6dabd0e5c927} \
  692.     -font {-*-utopia-medium-r-*-*-16-*-*-*-*-*-*-*} \
  693.     -height {1} \
  694.     -width {46}
  695.   # bindings
  696.   bind .packMethodsFrame.text0 <Any-Key> {{NoFunction}}
  697.  
  698.   # build widget .packMethodsFrame.text1
  699.   text .packMethodsFrame.text1 \
  700.     -background {#6dabd0e5c927} \
  701.     -font {-*-utopia-medium-r-*-*-16-*-*-*-*-*-*-*} \
  702.     -height {1}
  703.   # bindings
  704.   bind .packMethodsFrame.text1 <Any-Key> {{NoFunction}}
  705.  
  706.   # build widget .packMethodsFrame.text7
  707.   text .packMethodsFrame.text7 \
  708.     -background {#6dabd0e5c927} \
  709.     -font {-*-utopia-medium-r-*-*-16-*-*-*-*-*-*-*} \
  710.     -height {1}
  711.   # bindings
  712.   bind .packMethodsFrame.text7 <Any-Key> {{NoFunction}}
  713.  
  714.   # build widget .packMethodsFrame.text8
  715.   text .packMethodsFrame.text8 \
  716.     -background {#6dabd0e5c927} \
  717.     -font {-*-utopia-medium-r-*-*-16-*-*-*-*-*-*-*} \
  718.     -height {1}
  719.   # bindings
  720.   bind .packMethodsFrame.text8 <Any-Key> {{NoFunction}}
  721.  
  722.   # pack widget .packMethodsFrame
  723.   pack append .packMethodsFrame \
  724.     .packMethodsFrame.label3 {left frame nw fillx} \
  725.     .packMethodsFrame.afio {left frame nw} \
  726.     .packMethodsFrame.afio0 {left frame nw} \
  727.     .packMethodsFrame.tar {left frame nw} \
  728.     .packMethodsFrame.tarcpio {left frame nw} \
  729.     .packMethodsFrame.text0 {bottom frame w}
  730.  
  731.   # build widget .writeMethodFrame
  732.   frame .writeMethodFrame \
  733.     -background {#bfbfbf} \
  734.     -borderwidth {1} \
  735.     -geometry {37x213} \
  736.     -relief {sunken}
  737.  
  738.   # build widget .writeMethodFrame.writeMethodButtonFrame
  739.   frame .writeMethodFrame.writeMethodButtonFrame \
  740.     -background {#bfbfbf} \
  741.     -borderwidth {4}
  742.  
  743.   # build widget .writeMethodFrame.writeMethodButtonFrame.label10
  744.   label .writeMethodFrame.writeMethodButtonFrame.label10 \
  745.     -background {#fef97cf07cf0} \
  746.     -font {-Adobe-Helvetica-*-r-*-*-14-*-*-*-*-*-*-*} \
  747.     -height {1} \
  748.     -relief {raised} \
  749.     -text {Write Methods...}
  750.  
  751.   # build widget .writeMethodFrame.writeMethodButtonFrame.floppy
  752.   radiobutton .writeMethodFrame.writeMethodButtonFrame.floppy \
  753.     -activebackground {#8c0495e9aac0} \
  754.     -background {#bfbfbf} \
  755.     -borderwidth {1} \
  756.     -command {ForgetWindow .writeMethodFrame.message2;
  757. ForgetWindow .writeMethodFrame.filedevframe ;
  758. pack .writeMethodFrame.floppychoiceframe  -anchor w -side left -expand 1} \
  759.     -height {2} \
  760.     -text {floppy} \
  761.     -value {floppy} \
  762.     -variable {writemethod}
  763.  
  764.   # build widget .writeMethodFrame.writeMethodButtonFrame.tape
  765.   radiobutton .writeMethodFrame.writeMethodButtonFrame.tape \
  766.     -activebackground {#8c0495e9aac0} \
  767.     -background {#bfbfbf} \
  768.     -borderwidth {1} \
  769.     -command {ForgetWindow .writeMethodFrame.floppychoiceframe ;
  770. ForgetWindow .writeMethodFrame.message2 ;
  771. ForgetWindow .writeMethodFrame.filedevframe} \
  772.     -height {2} \
  773.     -text {tape} \
  774.     -value {tape} \
  775.     -variable {writemethod}
  776.  
  777.   # build widget .writeMethodFrame.writeMethodButtonFrame.filedev
  778.   radiobutton .writeMethodFrame.writeMethodButtonFrame.filedev \
  779.     -activebackground {#8c0495e9aac0} \
  780.     -background {#bfbfbf} \
  781.     -borderwidth {1} \
  782.     -command {ForgetWindow .writeMethodFrame.floppychoiceframe ;
  783. ForgetWindow .writeMethodFrame.message2 ;
  784. pack .writeMethodFrame.filedevframe -side left -anchor c -expand 1} \
  785.     -height {2} \
  786.     -text {filedev} \
  787.     -value {filedev} \
  788.     -variable {writemethod}
  789.  
  790.   # build widget .writeMethodFrame.writeMethodButtonFrame.bitbucket
  791.   radiobutton .writeMethodFrame.writeMethodButtonFrame.bitbucket \
  792.     -activebackground {#8c0495e9aac0} \
  793.     -background {#bfbfbf} \
  794.     -borderwidth {1} \
  795.     -command {ForgetWindow .writeMethodFrame.floppychoiceframe ;
  796. ForgetWindow .writeMethodFrame.filedevframe ;
  797. pack .writeMethodFrame.message2 -side left -anchor c} \
  798.     -height {2} \
  799.     -text {/dev/null} \
  800.     -value {null} \
  801.     -variable {writemethod}
  802.  
  803.   # pack widget .writeMethodFrame.writeMethodButtonFrame
  804.   pack append .writeMethodFrame.writeMethodButtonFrame \
  805.     .writeMethodFrame.writeMethodButtonFrame.label10 {top frame center padx 20 fillx} \
  806.     .writeMethodFrame.writeMethodButtonFrame.floppy {top frame nw expand fill} \
  807.     .writeMethodFrame.writeMethodButtonFrame.tape {top frame nw expand fill} \
  808.     .writeMethodFrame.writeMethodButtonFrame.filedev {top frame nw expand fill} \
  809.     .writeMethodFrame.writeMethodButtonFrame.bitbucket {top frame center fillx}
  810.  
  811.   # build widget .writeMethodFrame.floppychoiceframe
  812.   frame .writeMethodFrame.floppychoiceframe \
  813.     -background {#bfbfbf} \
  814.     -borderwidth {2} \
  815.     -relief {sunken}
  816.  
  817.   # build widget .writeMethodFrame.floppychoiceframe.floppynameframe
  818.   frame .writeMethodFrame.floppychoiceframe.floppynameframe \
  819.     -background {#bfbfbf} \
  820.     -borderwidth {2}
  821.  
  822.   # build widget .writeMethodFrame.floppychoiceframe.floppynameframe.floppylabel
  823.   label .writeMethodFrame.floppychoiceframe.floppynameframe.floppylabel \
  824.     -background {#bfbfbf} \
  825.     -borderwidth {0} \
  826.     -text {floppy device:   }
  827.  
  828.   # build widget .writeMethodFrame.floppychoiceframe.floppynameframe.floppy0
  829.   radiobutton .writeMethodFrame.floppychoiceframe.floppynameframe.floppy0 \
  830.     -activebackground {#e28ee28ee28e} \
  831.     -background {#bfbfbf} \
  832.     -relief {flat} \
  833.     -text {0} \
  834.     -value {0} \
  835.     -variable {mnr}
  836.  
  837.   # build widget .writeMethodFrame.floppychoiceframe.floppynameframe.floppy1
  838.   radiobutton .writeMethodFrame.floppychoiceframe.floppynameframe.floppy1 \
  839.     -activebackground {#e28ee28ee28e} \
  840.     -background {#bfbfbf} \
  841.     -relief {flat} \
  842.     -text {1} \
  843.     -value {1} \
  844.     -variable {mnr}
  845.  
  846.   # pack widget .writeMethodFrame.floppychoiceframe.floppynameframe
  847.   pack append .writeMethodFrame.floppychoiceframe.floppynameframe \
  848.     .writeMethodFrame.floppychoiceframe.floppynameframe.floppylabel {left frame center} \
  849.     .writeMethodFrame.floppychoiceframe.floppynameframe.floppy0 {left frame center} \
  850.     .writeMethodFrame.floppychoiceframe.floppynameframe.floppy1 {right frame center}
  851.  
  852.   # build widget .writeMethodFrame.floppychoiceframe.densityframe
  853.   frame .writeMethodFrame.floppychoiceframe.densityframe \
  854.     -background {#bfbfbf} \
  855.     -borderwidth {2}
  856.  
  857.   # build widget .writeMethodFrame.floppychoiceframe.densityframe.densitylabel
  858.   label .writeMethodFrame.floppychoiceframe.densityframe.densitylabel \
  859.     -background {#bfbfbf} \
  860.     -text {density:  }
  861.  
  862.   # build widget .writeMethodFrame.floppychoiceframe.densityframe.fd360
  863.   radiobutton .writeMethodFrame.floppychoiceframe.densityframe.fd360 \
  864.     -activebackground {#e28ee28ee28e} \
  865.     -background {#bfbfbf} \
  866.     -relief {flat} \
  867.     -text {d} \
  868.     -value {d} \
  869.     -variable {mdens}
  870.  
  871.   # build widget .writeMethodFrame.floppychoiceframe.densityframe.fd1200
  872.   radiobutton .writeMethodFrame.floppychoiceframe.densityframe.fd1200 \
  873.     -activebackground {#e28ee28ee28e} \
  874.     -background {#bfbfbf} \
  875.     -relief {flat} \
  876.     -text {xd} \
  877.     -value {xd} \
  878.     -variable {mdens}
  879.  
  880.   # build widget .writeMethodFrame.floppychoiceframe.densityframe.fd720
  881.   radiobutton .writeMethodFrame.floppychoiceframe.densityframe.fd720 \
  882.     -activebackground {#e28ee28ee28e} \
  883.     -background {#bfbfbf} \
  884.     -relief {flat} \
  885.     -text {h} \
  886.     -value {h} \
  887.     -variable {mdens}
  888.  
  889.   # build widget .writeMethodFrame.floppychoiceframe.densityframe.fd1440
  890.   radiobutton .writeMethodFrame.floppychoiceframe.densityframe.fd1440 \
  891.     -activebackground {#e28ee28ee28e} \
  892.     -background {#bfbfbf} \
  893.     -relief {flat} \
  894.     -text {xh} \
  895.     -value {xh} \
  896.     -variable {mdens}
  897.  
  898.   # pack widget .writeMethodFrame.floppychoiceframe.densityframe
  899.   pack append .writeMethodFrame.floppychoiceframe.densityframe \
  900.     .writeMethodFrame.floppychoiceframe.densityframe.densitylabel {left frame center} \
  901.     .writeMethodFrame.floppychoiceframe.densityframe.fd360 {left frame center} \
  902.     .writeMethodFrame.floppychoiceframe.densityframe.fd1200 {left frame center} \
  903.     .writeMethodFrame.floppychoiceframe.densityframe.fd720 {left frame center} \
  904.     .writeMethodFrame.floppychoiceframe.densityframe.fd1440 {left frame center}
  905.  
  906.   # build widget .writeMethodFrame.floppychoiceframe.formatoptionsframe
  907.   frame .writeMethodFrame.floppychoiceframe.formatoptionsframe \
  908.     -background {#bfbfbf} \
  909.     -borderwidth {2}
  910.  
  911.   # build widget .writeMethodFrame.floppychoiceframe.formatoptionsframe.format
  912.   checkbutton .writeMethodFrame.floppychoiceframe.formatoptionsframe.format \
  913.     -activebackground {#e28ee28ee28e} \
  914.     -background {#bfbfbf} \
  915.     -offvalue {n} \
  916.     -onvalue {y} \
  917.     -relief {flat} \
  918.     -text {format} \
  919.     -variable {formatalways}
  920.  
  921.   # build widget .writeMethodFrame.floppychoiceframe.formatoptionsframe.verify_format
  922.   checkbutton .writeMethodFrame.floppychoiceframe.formatoptionsframe.verify_format \
  923.     -activebackground {#e28ee28ee28e} \
  924.     -background {#bfbfbf} \
  925.     -offvalue {n} \
  926.     -onvalue {y} \
  927.     -relief {flat} \
  928.     -text {verify format} \
  929.     -variable {verifyformat}
  930.  
  931.   # build widget .writeMethodFrame.floppychoiceframe.formatoptionsframe.verify_after_write
  932.   checkbutton .writeMethodFrame.floppychoiceframe.formatoptionsframe.verify_after_write \
  933.     -activebackground {#e28ee28ee28e} \
  934.     -background {#bfbfbf} \
  935.     -offvalue {n} \
  936.     -onvalue {y} \
  937.     -relief {flat} \
  938.     -text {verify after write} \
  939.     -variable {verifywrite}
  940.  
  941.   # pack widget .writeMethodFrame.floppychoiceframe.formatoptionsframe
  942.   pack append .writeMethodFrame.floppychoiceframe.formatoptionsframe \
  943.     .writeMethodFrame.floppychoiceframe.formatoptionsframe.format {top frame nw} \
  944.     .writeMethodFrame.floppychoiceframe.formatoptionsframe.verify_format {top frame nw} \
  945.     .writeMethodFrame.floppychoiceframe.formatoptionsframe.verify_after_write {top frame nw}
  946.  
  947.   # build widget .writeMethodFrame.floppychoiceframe.showbackuplist
  948.   button .writeMethodFrame.floppychoiceframe.showbackuplist \
  949.     -activebackground {black} \
  950.     -activeforeground {#bfbfbf} \
  951.     -background {#bfbfbf} \
  952.     -borderwidth {3} \
  953.     -command {ShowWindow.filedescriptionwindow} \
  954.     -foreground {black} \
  955.     -relief {groove} \
  956.     -text {Show Backup Description.}
  957.  
  958.   # pack widget .writeMethodFrame.floppychoiceframe
  959.   pack append .writeMethodFrame.floppychoiceframe \
  960.     .writeMethodFrame.floppychoiceframe.floppynameframe {top frame nw} \
  961.     .writeMethodFrame.floppychoiceframe.densityframe {top frame nw} \
  962.     .writeMethodFrame.floppychoiceframe.formatoptionsframe {top frame nw} \
  963.     .writeMethodFrame.floppychoiceframe.showbackuplist {top frame center}
  964.  
  965.   # build widget .writeMethodFrame.message2
  966.   message .writeMethodFrame.message2 \
  967.     -aspect {167} \
  968.     -background {#bfbfbf} \
  969.     -font {-*-utopia-bold-i-*-*-30-*-100-75-*-*-*-*} \
  970.     -foreground {White} \
  971.     -justify {center} \
  972.     -padx {5} \
  973.     -pady {2} \
  974.     -text {To the Bit Bucket!}
  975.  
  976.   # build widget .writeMethodFrame.filedevframe
  977.   frame .writeMethodFrame.filedevframe \
  978.     -background {#bfbfbf} \
  979.     -borderwidth {2}
  980.  
  981.   # build widget .writeMethodFrame.filedevframe.scrollbar0
  982.   scrollbar .writeMethodFrame.filedevframe.scrollbar0 \
  983.     -background {#bfbfbf} \
  984.     -borderwidth {0} \
  985.     -command {.writeMethodFrame.filedevframe.enterdirset view} \
  986.     -foreground {#bfbfbf} \
  987.     -orient {horizontal} \
  988.     -relief {sunken} \
  989.     -width {11}
  990.  
  991.   # build widget .writeMethodFrame.filedevframe.text1
  992.   text .writeMethodFrame.filedevframe.text1 \
  993.     -background {#bfbfbf} \
  994.     -borderwidth {8} \
  995.     -font {*-times-medium-r-*-*-14-*-*-*-*-*-*-*} \
  996.     -height {3} \
  997.     -width {30} \
  998.     -wrap {none}
  999.   # bindings
  1000.   bind .writeMethodFrame.filedevframe.text1 <Any-Key> {NoFunction}
  1001.  
  1002.   # build widget .writeMethodFrame.filedevframe.enterfiledev
  1003.   entry .writeMethodFrame.filedevframe.enterfiledev \
  1004.     -background {#ffffff0ea1ca} \
  1005.     -font {-*-courier-bold-r-normal-*-15-*-*-*-*-*-*-*} \
  1006.     -relief {sunken} \
  1007.     -scrollcommand {.writeMethodFrame.filedevframe.scrollbar0 set} \
  1008.     -width {35}
  1009.  
  1010.   # pack widget .writeMethodFrame.filedevframe
  1011.   pack append .writeMethodFrame.filedevframe \
  1012.     .writeMethodFrame.filedevframe.text1 {top frame nw padx 200} \
  1013.     .writeMethodFrame.filedevframe.enterfiledev {top frame w} \
  1014.     .writeMethodFrame.filedevframe.scrollbar0 {bottom frame center fillx}
  1015.  
  1016.   # build widget .writeMethodFrame.doIT
  1017.   button .writeMethodFrame.doIT \
  1018.     -activebackground {#fffff1260000} \
  1019.     -background {#a0c49c1095ac} \
  1020.     -borderwidth {4} \
  1021.     -command {puts stdout $setnameselection ; exec xterm -e tbackup -this} \
  1022.     -font {-*-*-demibold-i-*-*-24-*-*-*-*-*-*-*} \
  1023.     -height {3} \
  1024.     -text {DO IT!} \
  1025.     -width {8}
  1026.  
  1027.   # pack widget .writeMethodFrame
  1028.   pack append .writeMethodFrame \
  1029.     .writeMethodFrame.writeMethodButtonFrame {left frame w pady 82 expand filly} \
  1030.     .writeMethodFrame.doIT {right frame se padx 139 expand} \
  1031.     .writeMethodFrame.floppychoiceframe {left frame w expand}
  1032.  
  1033.   # pack widget .
  1034.   pack append . \
  1035.     .topmenubar {top frame w fillx} \
  1036.     .backuptypeframe {top frame center fillx} \
  1037.     .chooseMethodFrame {top frame w expand fill} \
  1038.     .packMethodsFrame {top frame w expand fill} \
  1039.     .writeMethodFrame {bottom frame w expand fill}
  1040.  
  1041.   global tkVersion
  1042.   if {$tkVersion >= 3.0} {
  1043.     tk_menuBar .topmenubar .topmenubar.menubutton1 .topmenubar.menubutton2 .topmenubar.actionmenu
  1044.   } {
  1045.     tk_menus . .topmenubar.menubutton1 .topmenubar.menubutton2 .topmenubar.actionmenu
  1046.   }
  1047.  
  1048.   .backuptypeframe.text0 insert end {  full backup of all files in the set}
  1049.   .backuptypeframe.text1 insert end {  backup all files changed since last backup}
  1050.   .backuptypeframe.text2 insert end {  backup of files backed up since last incremental (if) backup}
  1051.   .chooseMethodFrame.frame.listbox1 insert end {dos -- dos filesystem }
  1052.   .chooseMethodFrame.frame.listbox1 insert end { ext -- extended filesystem. }
  1053.   .chooseMethodFrame.frame.listbox1 insert end { foo -- a set called foo }
  1054.   .chooseMethodFrame.frame.listbox1 insert end { mystuff -- my stuff in the /root directory. }
  1055.   .chooseMethodFrame.frame.listbox1 insert end { nocdrom -- back up everything under / }
  1056.   .chooseMethodFrame.frame.listbox1 insert end { system -- root filesystem, without /root dir.}
  1057.   .chooseMethodFrame.sethelpframe.text1 insert end {set--back up a directory 
  1058. set.}
  1059.   .chooseMethodFrame.setRMhelpframe.text1 insert end {setrm--backup a directory
  1060. set and delete the files in
  1061. the set.}
  1062.   .chooseMethodFrame.onehelpframe.text1 insert end {one--enter directory set
  1063. below (e.g. / or /dosc or /[whatever])}
  1064.   .chooseMethodFrame.onemethodframe.enterdirset insert end {}
  1065.   .packMethodsFrame.text0 insert end {  afio--pack files with afio (best)}
  1066.   .packMethodsFrame.text1 insert end {  afio0--afio w/no compression}
  1067.   .packMethodsFrame.text7 insert end {  tar--use tar (no error recovery)}
  1068.   .packMethodsFrame.text8 insert end {  tarcpio--tar w/cpio (no compress)}
  1069.   .writeMethodFrame.filedevframe.text1 insert end {filedev--enter file or device to 
  1070. write to below (e.g.  /tmp/hda1 or
  1071. /dev/tape or  /[foo0]/[foo1], etc.)}
  1072.   .writeMethodFrame.filedevframe.enterfiledev insert end {}
  1073.  
  1074.  
  1075.  
  1076.   if {"[info procs XFEdit]" != ""} {
  1077.     catch "XFMiscBindWidgetTree ."
  1078.     after 2 "catch {XFEditSetShowWindows}"
  1079.   }
  1080. }
  1081.  
  1082.  
  1083. # User defined procedures
  1084.  
  1085.  
  1086. # Procedure: FSBox
  1087. proc FSBox { {fsBoxMessage "Select file:"} {fsBoxFileName ""} {fsBoxActionOk ""} {fsBoxActionCancel ""}} {
  1088. # xf ignore me 5
  1089. ##########
  1090. # Procedure: FSBox
  1091. # Description: show file selector box
  1092. # Arguments: fsBoxMessage - the text to display
  1093. #            fsBoxFileName - a file name that should be selected
  1094. #            fsBoxActionOk - the action that should be performed on ok
  1095. #            fsBoxActionCancel - the action that should be performed on cancel
  1096. # Returns: the filename that was selected, or nothing
  1097. # Sideeffects: none
  1098. ##########
  1099. # global fsBox(activeBackground) - active background color
  1100. # global fsBox(activeForeground) - active foreground color
  1101. # global fsBox(background) - background color
  1102. # global fsBox(font) - text font
  1103. # global fsBox(foreground) - foreground color
  1104. # global fsBox(extensions) - scan directory for extensions
  1105. # global fsBox(scrollActiveForeground) - scrollbar active background color
  1106. # global fsBox(scrollBackground) - scrollbar background color
  1107. # global fsBox(scrollForeground) - scrollbar foreground color
  1108. # global fsBox(scrollSide) - side where scrollbar is located
  1109.  
  1110.   global fsBox
  1111.     set fsBox(activeBackground) "#bfbfbf"
  1112.     set fsBox(background) "#bfbfbf"
  1113.     set fsBox(scrollBackground) "#bfbfbf"
  1114.     set fsBox(scrollActiveForeground) "#bfbfbf"
  1115.     set fsBox(scrollForeground) "#bfbfbf"
  1116.     set fsBox(scrollSide) "right"
  1117.     set fsBox(pattern) "*.arg"
  1118.     set fsBox(path) "/etc/tbackup"
  1119.   set tmpButtonOpt ""
  1120.   set tmpFrameOpt ""
  1121.   set tmpMessageOpt ""
  1122.   set tmpScaleOpt ""
  1123.   set tmpScrollOpt ""
  1124.   if {"$fsBox(activeBackground)" != ""} {
  1125.     append tmpButtonOpt "-activebackground \"$fsBox(activeBackground)\" "
  1126.   }
  1127.   if {"$fsBox(activeForeground)" != ""} {
  1128.     append tmpButtonOpt "-activeforeground \"$fsBox(activeForeground)\" "
  1129.   }
  1130.   if {"$fsBox(background)" != ""} {
  1131.     append tmpButtonOpt "-background \"$fsBox(background)\" "
  1132.     append tmpFrameOpt "-background \"$fsBox(background)\" "
  1133.     append tmpMessageOpt "-background \"$fsBox(background)\" "
  1134.   }
  1135.   if {"$fsBox(font)" != ""} {
  1136.     append tmpButtonOpt "-font \"$fsBox(font)\" "
  1137.     append tmpMessageOpt "-font \"$fsBox(font)\" "
  1138.   }
  1139.   if {"$fsBox(foreground)" != ""} {
  1140.     append tmpButtonOpt "-foreground \"$fsBox(foreground)\" "
  1141.     append tmpMessageOpt "-foreground \"$fsBox(foreground)\" "
  1142.   }
  1143.   if {"$fsBox(scrollActiveForeground)" != ""} {
  1144.     append tmpScrollOpt "-activeforeground \"$fsBox(scrollActiveForeground)\" "
  1145.   }
  1146.   if {"$fsBox(scrollBackground)" != ""} {
  1147.     append tmpScrollOpt "-background \"$fsBox(scrollBackground)\" "
  1148.   }
  1149.   if {"$fsBox(scrollForeground)" != ""} {
  1150.     append tmpScrollOpt "-foreground \"$fsBox(scrollForeground)\" "
  1151.   }
  1152.  
  1153.   if {[file exists [file tail $fsBoxFileName]] &&
  1154.       [IsAFile [file tail $fsBoxFileName]]} {
  1155.     set fsBox(name) [file tail $fsBoxFileName]
  1156.   } {
  1157.     set fsBox(name) ""
  1158.   }
  1159.   if {[file exists $fsBoxFileName] && [IsADir $fsBoxFileName]} {
  1160.     set fsBox(path) $fsBoxFileName
  1161.   } {
  1162.     if {"[file dirname $fsBoxFileName]" != "."} {
  1163.       set fsBox(path) [file dirname $fsBoxFileName]
  1164.     }
  1165.   }
  1166.   if {$fsBox(showPixmap)} {
  1167.     set fsBox(path) [string trimleft $fsBox(path) @]
  1168.   }
  1169.   if {"$fsBox(path)" != "" && [file exists $fsBox(path)] &&
  1170.       [IsADir $fsBox(path)]} {
  1171.     set fsBox(internalPath) $fsBox(path)
  1172.   } {
  1173.     if {"$fsBox(internalPath)" == "" ||
  1174.         ![file exists $fsBox(internalPath)]} {
  1175.       set fsBox(internalPath) [pwd]
  1176.     }
  1177.   }
  1178.   # build widget structure
  1179.  
  1180.   # start build of toplevel
  1181.   if {"[info commands XFDestroy]" != ""} {
  1182.     catch {XFDestroy .fsBox}
  1183.   } {
  1184.     catch {destroy .fsBox}
  1185.   }
  1186.   toplevel .fsBox  -borderwidth 0
  1187.   catch ".fsBox config $tmpFrameOpt"
  1188.   wm geometry .fsBox 350x300 
  1189.   wm title .fsBox {Save your configuration to a file.}
  1190.   wm maxsize .fsBox 1000 1000
  1191.   wm minsize .fsBox 100 100
  1192.   # end build of toplevel
  1193.  
  1194.   label .fsBox.message1  -anchor c  -relief raised  -text "$fsBoxMessage"
  1195.   catch ".fsBox.message1 config $tmpMessageOpt"
  1196.  
  1197.   frame .fsBox.frame1  -borderwidth 0  -relief raised
  1198.   catch ".fsBox.frame1 config $tmpFrameOpt"
  1199.  
  1200.   button .fsBox.frame1.ok  -text "OK"  -command "
  1201.       global fsBox
  1202.       set fsBox(name) \[.fsBox.file.file get\]
  1203.       if {$fsBox(showPixmap)} {
  1204.         set fsBox(path) @\[.fsBox.path.path get\]
  1205.       } {
  1206.         set fsBox(path) \[.fsBox.path.path get\]
  1207.       }
  1208.       set fsBox(internalPath) \[.fsBox.path.path get\]
  1209.       $fsBoxActionOk
  1210.       if {\"\[info commands XFDestroy\]\" != \"\"} {
  1211.         catch {XFDestroy .fsBox}
  1212.       } {
  1213.         catch {destroy .fsBox}
  1214.       }"
  1215.   catch ".fsBox.frame1.ok config $tmpButtonOpt"
  1216.  
  1217.   button .fsBox.frame1.rescan  -text "Rescan"  -command {
  1218.       global fsBox
  1219.       FSBoxFSShow [.fsBox.path.path get]  [.fsBox.pattern.pattern get] $fsBox(all)}
  1220.   catch ".fsBox.frame1.rescan config $tmpButtonOpt"
  1221.  
  1222.   button .fsBox.frame1.cancel  -text "Cancel"  -command "
  1223.       global fsBox
  1224.       set fsBox(name) {}
  1225.       set fsBox(path) {}
  1226.       $fsBoxActionCancel
  1227.       if {\"\[info commands XFDestroy\]\" != \"\"} {
  1228.         catch {XFDestroy .fsBox}
  1229.       } {
  1230.         catch {destroy .fsBox}
  1231.       }"
  1232.   catch ".fsBox.frame1.cancel config $tmpButtonOpt"
  1233.  
  1234.   if {$fsBox(showPixmap)} {
  1235.     frame .fsBox.frame2  -borderwidth 0  -relief raised
  1236.     catch ".fsBox.frame2 config $tmpFrameOpt"
  1237.  
  1238.     scrollbar .fsBox.frame2.scrollbar3  -command {.fsBox.frame2.canvas2 xview}  -orient {horizontal}  -relief {raised}
  1239.     catch ".fsBox.frame2.scrollbar3 config $tmpScrollOpt"
  1240.  
  1241.     scrollbar .fsBox.frame2.scrollbar1  -command {.fsBox.frame2.canvas2 yview}  -relief {raised}
  1242.     catch ".fsBox.frame2.scrollbar1 config $tmpScrollOpt"
  1243.  
  1244.     canvas .fsBox.frame2.canvas2  -confine {true}  -relief {raised}  -scrollregion {0c 0c 20c 20c}  -width {100}  -xscrollcommand {.fsBox.frame2.scrollbar3 set}  -yscrollcommand {.fsBox.frame2.scrollbar1 set}
  1245.     catch ".fsBox.frame2.canvas2 config $tmpFrameOpt"
  1246.  
  1247.     .fsBox.frame2.canvas2 addtag currentBitmap withtag [.fsBox.frame2.canvas2 create bitmap 5 5 -anchor nw]
  1248.   }
  1249.  
  1250.   frame .fsBox.path  -borderwidth 0  -relief raised
  1251.   catch ".fsBox.path config $tmpFrameOpt"
  1252.  
  1253.   frame .fsBox.path.paths  -borderwidth 2  -relief raised
  1254.   catch ".fsBox.path.paths config $tmpFrameOpt"
  1255.  
  1256.   menubutton .fsBox.path.paths.paths  -borderwidth 0  -menu ".fsBox.path.paths.paths.menu"  -relief flat  -text "Pathname:"
  1257.   catch ".fsBox.path.paths.paths config $tmpButtonOpt"
  1258.  
  1259.   menu .fsBox.path.paths.paths.menu
  1260.   catch ".fsBox.path.paths.paths.menu config $tmpButtonOpt"
  1261.  
  1262.   .fsBox.path.paths.paths.menu add command  -label "[string trimright $fsBox(internalPath) {/@}]"  -command "
  1263.        global fsBox
  1264.        FSBoxFSShow \[.fsBox.path.path get\]  \[.fsBox.pattern.pattern get\] \$fsBox(all)
  1265.        .fsBox.path.path delete 0 end
  1266.        .fsBox.path.path insert 0 [string trimright $fsBox(internalPath) {/@}]"
  1267.  
  1268.   entry .fsBox.path.path  -relief raised
  1269.   catch ".fsBox.path.path config $tmpMessageOpt"
  1270.  
  1271.   if {![IsADir $fsBox(internalPath)]} {
  1272.     set $fsBox(internalPath) [pwd]
  1273.   }
  1274.   .fsBox.path.path insert 0 $fsBox(internalPath)
  1275.  
  1276.   frame .fsBox.pattern  -borderwidth 0  -relief raised
  1277.   catch ".fsBox.pattern config $tmpFrameOpt"
  1278.  
  1279.   frame .fsBox.pattern.patterns  -borderwidth 2  -relief raised
  1280.   catch ".fsBox.pattern.patterns config $tmpFrameOpt"
  1281.  
  1282.   menubutton .fsBox.pattern.patterns.patterns  -borderwidth 0  -menu ".fsBox.pattern.patterns.patterns.menu"  -relief flat  -text "Selection pattern:"
  1283.   catch ".fsBox.pattern.patterns.patterns config $tmpButtonOpt"
  1284.  
  1285.   menu .fsBox.pattern.patterns.patterns.menu
  1286.   catch ".fsBox.pattern.patterns.patterns.menu config $tmpButtonOpt"
  1287.  
  1288.   .fsBox.pattern.patterns.patterns.menu add checkbutton  -label "Scan extensions"  -variable fsBox(extensions)  -command {
  1289.       global fsBox
  1290.       FSBoxFSShow [.fsBox.path.path get]  [.fsBox.pattern.pattern get] $fsBox(all)}
  1291.  
  1292.   entry .fsBox.pattern.pattern  -relief raised
  1293.   catch ".fsBox.pattern.pattern config $tmpMessageOpt"
  1294.  
  1295.   .fsBox.pattern.pattern insert 0 $fsBox(pattern)
  1296.   
  1297.   frame .fsBox.files  -borderwidth 0  -relief raised
  1298.   catch ".fsBox.files config $tmpFrameOpt"
  1299.  
  1300.   scrollbar .fsBox.files.vscroll  -relief raised  -command ".fsBox.files.files yview"
  1301.   catch ".fsBox.files.vscroll config $tmpScrollOpt"
  1302.  
  1303.   scrollbar .fsBox.files.hscroll  -orient horiz  -relief raised  -command ".fsBox.files.files xview"
  1304.   catch ".fsBox.files.hscroll config $tmpScrollOpt"
  1305.  
  1306.   listbox .fsBox.files.files  -exportselection false  -relief raised  -xscrollcommand ".fsBox.files.hscroll set"  -yscrollcommand ".fsBox.files.vscroll set"
  1307.   catch ".fsBox.files.files config $tmpMessageOpt"
  1308.  
  1309.   frame .fsBox.file  -borderwidth 0  -relief raised
  1310.   catch ".fsBox.file config $tmpFrameOpt"
  1311.  
  1312.   label .fsBox.file.labelfile  -relief raised  -text "Filename:"
  1313.   catch ".fsBox.file.labelfile config $tmpMessageOpt"
  1314.  
  1315.   entry .fsBox.file.file  -relief raised
  1316.   catch ".fsBox.file.file config $tmpMessageOpt"
  1317.  
  1318.   .fsBox.file.file delete 0 end
  1319.   .fsBox.file.file insert 0 $fsBox(name)
  1320.   
  1321.   checkbutton .fsBox.pattern.all  -offvalue 0  -onvalue 1  -text "Show all files"  -variable fsBox(all)  -command {
  1322.       global fsBox
  1323.       FSBoxFSShow [.fsBox.path.path get]  [.fsBox.pattern.pattern get] $fsBox(all)}
  1324.   catch ".fsBox.pattern.all config $tmpButtonOpt"
  1325.  
  1326.   FSBoxFSShow $fsBox(internalPath) $fsBox(pattern) $fsBox(all)
  1327.  
  1328.   # bindings
  1329.   bind .fsBox.files.files <Double-Button-1> "
  1330.     FSBoxFSFileSelectDouble %W $fsBox(showPixmap) \{$fsBoxActionOk\} %y"
  1331.   bind .fsBox.files.files <ButtonPress-1> "
  1332.     FSBoxFSFileSelect %W $fsBox(showPixmap) %y"
  1333.   bind .fsBox.files.files <Button1-Motion> "
  1334.     FSBoxFSFileSelect %W $fsBox(showPixmap) %y"
  1335.   bind .fsBox.files.files <Shift-Button1-Motion> "
  1336.     FSBoxFSFileSelect %W $fsBox(showPixmap) %y"
  1337.   bind .fsBox.files.files <Shift-ButtonPress-1> "
  1338.     FSBoxFSFileSelect %W $fsBox(showPixmap) %y"
  1339.  
  1340.   bind .fsBox.path.path <Tab> {
  1341.     FSBoxFSNameComplete path}
  1342.   bind .fsBox.path.path <Return> {
  1343.     global tkVersion
  1344.     global fsBox
  1345.     FSBoxFSShow [.fsBox.path.path get]  [.fsBox.pattern.pattern get] $fsBox(all)
  1346.     FSBoxFSInsertPath
  1347.     if {$tkVersion >= 3.0} {
  1348.       .fsBox.file.file icursor end
  1349.     } {
  1350.       .fsBox.file.file cursor end
  1351.     }
  1352.     focus .fsBox.file.file}
  1353.   catch "bind .fsBox.path.path <Up> {}"
  1354.   bind .fsBox.path.path <Down> {
  1355.     global tkVersion
  1356.     if {$tkVersion >= 3.0} {
  1357.       .fsBox.file.file icursor end
  1358.     } {
  1359.       .fsBox.file.file cursor end
  1360.     }
  1361.     focus .fsBox.file.file}
  1362.  
  1363.   bind .fsBox.file.file <Tab> {
  1364.     FSBoxFSNameComplete file}
  1365.   bind .fsBox.file.file <Return> "
  1366.     global fsBox
  1367.     set fsBox(name) \[.fsBox.file.file get\]
  1368.     if {$fsBox(showPixmap)} {
  1369.       set fsBox(path) @\[.fsBox.path.path get\]
  1370.     } {
  1371.       set fsBox(path) \[.fsBox.path.path get\]
  1372.     }
  1373.     set fsBox(internalPath) \[.fsBox.path.path get\]
  1374.     $fsBoxActionOk
  1375.     if {\"\[info commands XFDestroy\]\" != \"\"} {
  1376.       catch {XFDestroy .fsBox}
  1377.     } {
  1378.       catch {destroy .fsBox}
  1379.     }"
  1380.   bind .fsBox.file.file <Up> {
  1381.     global tkVersion
  1382.     if {$tkVersion >= 3.0} {
  1383.       .fsBox.path.path icursor end
  1384.     } {
  1385.       .fsBox.path.path cursor end
  1386.     }
  1387.     focus .fsBox.path.path}
  1388.   bind .fsBox.file.file <Down> {
  1389.     global tkVersion
  1390.     if {$tkVersion >= 3.0} {
  1391.       .fsBox.pattern.pattern icursor end
  1392.     } {
  1393.       .fsBox.pattern.pattern cursor end
  1394.     }
  1395.     focus .fsBox.pattern.pattern}
  1396.  
  1397.   bind .fsBox.pattern.pattern <Return> {
  1398.     global fsBox
  1399.     FSBoxFSShow [.fsBox.path.path get]  [.fsBox.pattern.pattern get] $fsBox(all)}
  1400.   bind .fsBox.pattern.pattern <Up> {
  1401.     global tkVersion
  1402.     if {$tkVersion >= 3.0} {
  1403.       .fsBox.file.file icursor end
  1404.     } {
  1405.       .fsBox.file.file cursor end
  1406.     }
  1407.     focus .fsBox.file.file}
  1408.   catch "bind .fsBox.pattern.pattern <Down> {}"
  1409.  
  1410.   # packing
  1411.   pack append .fsBox.files  .fsBox.files.vscroll "$fsBox(scrollSide) filly"  .fsBox.files.hscroll {bottom fillx}  .fsBox.files.files {left fill expand}
  1412.   pack append .fsBox.file  .fsBox.file.labelfile {left}  .fsBox.file.file {left fill expand}
  1413.   pack append .fsBox.frame1  .fsBox.frame1.ok {left fill expand}  .fsBox.frame1.rescan {left fill expand}  .fsBox.frame1.cancel {left fill expand}
  1414.   pack append .fsBox.path.paths  .fsBox.path.paths.paths {left}
  1415.   pack append .fsBox.pattern.patterns  .fsBox.pattern.patterns.patterns {left}
  1416.   pack append .fsBox.path  .fsBox.path.paths {left}  .fsBox.path.path {left fill expand}
  1417.   pack append .fsBox.pattern  .fsBox.pattern.patterns {left}  .fsBox.pattern.all {right fill}  .fsBox.pattern.pattern {left fill expand}
  1418.   if {$fsBox(showPixmap)} {
  1419.     pack append .fsBox.frame2  .fsBox.frame2.scrollbar1 {left filly}  .fsBox.frame2.canvas2 {top expand fill}  .fsBox.frame2.scrollbar3 {top fillx} 
  1420.  
  1421.     pack append .fsBox  .fsBox.message1 {top fill}  .fsBox.frame1 {bottom fill}  .fsBox.pattern {bottom fill}  .fsBox.file {bottom fill}  .fsBox.path {bottom fill}  .fsBox.frame2 {right fill}  .fsBox.files {left fill expand}
  1422.   } {
  1423.     pack append .fsBox  .fsBox.message1 {top fill}  .fsBox.frame1 {bottom fill}  .fsBox.pattern {bottom fill}  .fsBox.file {bottom fill}  .fsBox.path {bottom fill}  .fsBox.files {left fill expand}
  1424.   }
  1425.  
  1426.   if {"$fsBoxActionOk" == "" && "$fsBoxActionCancel" == ""} {
  1427.     # wait for the box to be destroyed
  1428.     update idletask
  1429.     grab .fsBox
  1430.     tkwait window .fsBox
  1431.  
  1432.     if {"[string trim $fsBox(path)]" != "" ||
  1433.         "[string trim $fsBox(name)]" != ""} {
  1434.       if {"[string trimleft [string trim $fsBox(name)] /]" == ""} {
  1435.         return [string trimright [string trim $fsBox(path)] /]
  1436.       } {
  1437.         return [string trimright [string trim $fsBox(path)] /]/[string trimleft [string trim $fsBox(name)] /]
  1438.       }
  1439.     }
  1440.   }
  1441. }
  1442.  
  1443.  
  1444. # Procedure: FSBoxBindSelectOne
  1445. proc FSBoxBindSelectOne { fsBoxW fsBoxY} {
  1446. # xf ignore me 6
  1447.  
  1448.   set fsBoxNearest [$fsBoxW nearest $fsBoxY]
  1449.   if {$fsBoxNearest >= 0} {
  1450.     $fsBoxW select from $fsBoxNearest
  1451.     $fsBoxW select to $fsBoxNearest
  1452.   }
  1453. }
  1454.  
  1455.  
  1456. # Procedure: FSBoxFSFileSelect
  1457. proc FSBoxFSFileSelect { fsBoxW fsBoxShowPixmap fsBoxY} {
  1458. # xf ignore me 6
  1459.   global fsBox
  1460.  
  1461.   FSBoxBindSelectOne $fsBoxW $fsBoxY
  1462.   set fsBoxNearest [$fsBoxW nearest $fsBoxY]
  1463.   if {$fsBoxNearest >= 0} {
  1464.     set fsBoxTmpEntry [$fsBoxW get $fsBoxNearest]
  1465.     if {"[string index $fsBoxTmpEntry  [expr [string length $fsBoxTmpEntry]-1]]" == "/" ||
  1466.         "[string index $fsBoxTmpEntry  [expr [string length $fsBoxTmpEntry]-1]]" == "@"} {
  1467.       set fsBoxFileName [string range $fsBoxTmpEntry 0  [expr [string length $fsBoxTmpEntry]-2]]
  1468.       if {![IsADir [string trimright $fsBox(internalPath)/$fsBoxFileName @]] &&
  1469.           ![IsASymlink [string trimright $fsBox(internalPath)/$fsBoxFileName @]]} {
  1470.         set fsBoxFileName $fsBoxTmpEntry
  1471.       }
  1472.     } {
  1473.       if {"[string index $fsBoxTmpEntry  [expr [string length $fsBoxTmpEntry]-1]]" == "*"} {
  1474.         set fsBoxFileName [string range $fsBoxTmpEntry 0  [expr [string length $fsBoxTmpEntry]-2]]
  1475.         if {![file executable $fsBox(internalPath)/$fsBoxFileName]} {
  1476.           set fsBoxFileName $fsBoxTmpEntry
  1477.         }
  1478.       } {
  1479.         set fsBoxFileName $fsBoxTmpEntry
  1480.       }
  1481.     }
  1482.     if {![IsADir [string trimright $fsBox(internalPath)/$fsBoxFileName @]]} {
  1483.       set fsBox(name) $fsBoxFileName
  1484.       .fsBox.file.file delete 0 end
  1485.       .fsBox.file.file insert 0 $fsBox(name)
  1486.       if {$fsBoxShowPixmap} {
  1487.         catch ".fsBox.frame2.canvas2 itemconfigure currentBitmap -bitmap \"@$fsBox(internalPath)/$fsBox(name)\""
  1488.       }
  1489.     }
  1490.   }
  1491. }
  1492.  
  1493.  
  1494. # Procedure: FSBoxFSFileSelectDouble
  1495. proc FSBoxFSFileSelectDouble { fsBoxW fsBoxShowPixmap fsBoxAction fsBoxY} {
  1496. # xf ignore me 6
  1497.   global fsBox
  1498.  
  1499.   FSBoxBindSelectOne $fsBoxW $fsBoxY
  1500.   set fsBoxNearest [$fsBoxW nearest $fsBoxY]
  1501.   if {$fsBoxNearest >= 0} {
  1502.     set fsBoxTmpEntry [$fsBoxW get $fsBoxNearest]
  1503.     if {"$fsBoxTmpEntry" == "../"} {
  1504.       set fsBoxTmpEntry [string trimright [string trim $fsBox(internalPath)] "@/"]
  1505.       if {"$fsBoxTmpEntry" == ""} {
  1506.         return
  1507.       }
  1508.       FSBoxFSShow [file dirname $fsBoxTmpEntry]  [.fsBox.pattern.pattern get] $fsBox(all)
  1509.       .fsBox.path.path delete 0 end
  1510.       .fsBox.path.path insert 0 $fsBox(internalPath)
  1511.     } {
  1512.       if {"[string index $fsBoxTmpEntry  [expr [string length $fsBoxTmpEntry]-1]]" == "/" ||
  1513.           "[string index $fsBoxTmpEntry  [expr [string length $fsBoxTmpEntry]-1]]" == "@"} {
  1514.         set fsBoxFileName [string range $fsBoxTmpEntry 0  [expr [string length $fsBoxTmpEntry]-2]]
  1515.         if {![IsADir [string trimright $fsBox(internalPath)/$fsBoxFileName @]] &&
  1516.             ![IsASymlink [string trimright $fsBox(internalPath)/$fsBoxFileName @]]} {
  1517.           set fsBoxFileName $fsBoxTmpEntry
  1518.         }
  1519.       } {
  1520.         if {"[string index $fsBoxTmpEntry  [expr [string length $fsBoxTmpEntry]-1]]" == "*"} {
  1521.           set fsBoxFileName [string range $fsBoxTmpEntry 0  [expr [string length $fsBoxTmpEntry]-2]]
  1522.           if {![file executable $fsBox(internalPath)/$fsBoxFileName]} {
  1523.             set fsBoxFileName $fsBoxTmpEntry
  1524.           }
  1525.         } {
  1526.           set fsBoxFileName $fsBoxTmpEntry
  1527.         }
  1528.       }
  1529.       if {[IsADir [string trimright $fsBox(internalPath)/$fsBoxFileName @]]} {
  1530.         set fsBox(internalPath) "[string trimright $fsBox(internalPath) {/@}]/$fsBoxFileName"
  1531.         FSBoxFSShow $fsBox(internalPath)  [.fsBox.pattern.pattern get] $fsBox(all)
  1532.         .fsBox.path.path delete 0 end
  1533.         .fsBox.path.path insert 0 $fsBox(internalPath)
  1534.       } {
  1535.         set fsBox(name) $fsBoxFileName
  1536.         if {$fsBoxShowPixmap} {
  1537.           set fsBox(path) @$fsBox(internalPath)
  1538.         } {
  1539.           set fsBox(path) $fsBox(internalPath)
  1540.         }
  1541.         if {"$fsBoxAction" != ""} {
  1542.           eval "global fsBox; $fsBoxAction"
  1543.         }
  1544.         if {"[info commands XFDestroy]" != ""} {
  1545.           catch {XFDestroy .fsBox}
  1546.         } {
  1547.           catch {destroy .fsBox}
  1548.         }
  1549.       }
  1550.     }
  1551.   }
  1552. }
  1553.  
  1554.  
  1555. # Procedure: FSBoxFSInsertPath
  1556. proc FSBoxFSInsertPath {} {
  1557. # xf ignore me 6
  1558.   global fsBox
  1559.  
  1560.   set fsBoxLast [.fsBox.path.paths.paths.menu index last]
  1561.   set fsBoxNewEntry [string trimright [.fsBox.path.path get] "/@"]
  1562.   for {set fsBoxCounter 0} {$fsBoxCounter <= $fsBoxLast} {incr fsBoxCounter 1} {
  1563.     if {"$fsBoxNewEntry" ==  "[lindex [.fsBox.path.paths.paths.menu entryconfigure  $fsBoxCounter -label] 4]"} {
  1564.       return
  1565.     }
  1566.   }
  1567.   if {$fsBoxLast < 9} {
  1568.     .fsBox.path.paths.paths.menu add command  -label "$fsBoxNewEntry"  -command "
  1569.         global fsBox
  1570.         FSBoxFSShow $fsBoxNewEntry  \[.fsBox.pattern.pattern get\] \$fsBox(all)
  1571.         .fsBox.path.path delete 0 end
  1572.         .fsBox.path.path insert 0 $fsBoxNewEntry"
  1573.   } {
  1574.     for {set fsBoxCounter 0} {$fsBoxCounter < $fsBoxLast} {incr fsBoxCounter 1} {
  1575.       .fsBox.path.paths.paths.menu entryconfigure  $fsBoxCounter -label  [lindex [.fsBox.path.paths.paths.menu entryconfigure  [expr $fsBoxCounter+1] -label] 4]
  1576.       .fsBox.path.paths.paths.menu entryconfigure $fsBoxCounter  -command "
  1577.           global fsBox
  1578.           FSBoxFSShow [lindex [.fsBox.path.paths.paths.menu entryconfigure  [expr $fsBoxCounter+1] -label] 4]  \[.fsBox.pattern.pattern get\] \$fsBox(all)
  1579.           .fsBox.path.path delete 0 end
  1580.           .fsBox.path.path insert 0 [lindex  [.fsBox.path.paths.paths.menu entryconfigure  [expr $fsBoxCounter+1] -label] 4]"
  1581.     }
  1582.     .fsBox.path.paths.paths.menu entryconfigure $fsBoxLast  -label "$fsBoxNewEntry"
  1583.     .fsBox.path.paths.paths.menu entryconfigure $fsBoxCounter  -command "
  1584.         global fsBox
  1585.         FSBoxFSShow \[.fsBox.path.path get\]  \[.fsBox.pattern.pattern get\] \$fsBox(all)
  1586.         .fsBox.path.path delete 0 end
  1587.         .fsBox.path.path insert 0 $fsBoxNewEntry"
  1588.   }
  1589. }
  1590.  
  1591.  
  1592. # Procedure: FSBoxFSNameComplete
  1593. proc FSBoxFSNameComplete { fsBoxType} {
  1594. # xf ignore me 6
  1595.   global tkVersion
  1596.   global fsBox
  1597.  
  1598.   set fsBoxNewFile ""
  1599.   if {"$fsBoxType" == "path"} {
  1600.     set fsBoxDirName [file dirname [.fsBox.path.path get]]
  1601.     set fsBoxFileName [file tail [.fsBox.path.path get]]
  1602.   } {
  1603.     set fsBoxDirName [file dirname [.fsBox.path.path get]/]
  1604.     set fsBoxFileName [file tail [.fsBox.file.file get]]
  1605.   }
  1606.  
  1607.   set fsBoxNewFile ""
  1608.   if {[IsADir [string trimright $fsBoxDirName @]]} {
  1609.     catch "glob -nocomplain $fsBoxDirName/${fsBoxFileName}*" fsBoxResult
  1610.     foreach fsBoxCounter $fsBoxResult {
  1611.       if {"$fsBoxNewFile" == ""} {
  1612.         set fsBoxNewFile [file tail $fsBoxCounter]
  1613.       } {
  1614.         if {"[string index [file tail $fsBoxCounter] 0]" !=
  1615.             "[string index $fsBoxNewFile 0]"} {
  1616.           set fsBoxNewFile ""
  1617.           break
  1618.         }
  1619.         set fsBoxCounter1 0
  1620.         set fsBoxTmpFile1 $fsBoxNewFile
  1621.         set fsBoxTmpFile2 [file tail $fsBoxCounter]
  1622.         set fsBoxLength1 [string length $fsBoxTmpFile1]
  1623.         set fsBoxLength2 [string length $fsBoxTmpFile2]
  1624.         set fsBoxNewFile ""
  1625.         if {$fsBoxLength1 > $fsBoxLength2} {
  1626.           set fsBoxLength1 $fsBoxLength2
  1627.         }
  1628.         while {$fsBoxCounter1 < $fsBoxLength1} {
  1629.           if {"[string index $fsBoxTmpFile1 $fsBoxCounter1]" ==  "[string index $fsBoxTmpFile2 $fsBoxCounter1]"} {
  1630.             append fsBoxNewFile [string index $fsBoxTmpFile1 $fsBoxCounter1]
  1631.           } {
  1632.             break
  1633.           }
  1634.           incr fsBoxCounter1 1
  1635.         }
  1636.       }
  1637.     }
  1638.   }
  1639.   if {"$fsBoxNewFile" != ""} {
  1640.     if {[IsADir [string trimright $fsBoxDirName/$fsBoxNewFile @]] ||
  1641.         ![IsAFile [string trimright $fsBoxDirName/$fsBoxNewFile @]]} {
  1642.       if {[IsADir [string trimright $fsBoxDirName/$fsBoxNewFile @]]} {
  1643.         if {"$fsBoxDirName" == "/"} {
  1644.           .fsBox.path.path delete 0 end
  1645.           .fsBox.path.path insert 0 "/[string trimright [string trim $fsBoxNewFile /] @]/"
  1646.         } {
  1647.           .fsBox.path.path delete 0 end
  1648.           .fsBox.path.path insert 0 "[string trimright $fsBoxDirName /]/[string trimright [string trim $fsBoxNewFile /] @]/"
  1649.         }
  1650.         FSBoxFSShow [.fsBox.path.path get]  [.fsBox.pattern.pattern get] $fsBox(all)
  1651.         FSBoxFSInsertPath
  1652.       } {
  1653.         .fsBox.path.path delete 0 end
  1654.         .fsBox.path.path insert 0 "[string trimright $fsBoxDirName /]/[string trimright [string trim $fsBoxNewFile /] @]"
  1655.       }
  1656.     } {
  1657.       .fsBox.path.path delete 0 end
  1658.       .fsBox.path.path insert 0 "[string trimright $fsBoxDirName {@/}]/"
  1659.       .fsBox.file.file delete 0 end
  1660.       .fsBox.file.file insert 0 $fsBoxNewFile
  1661.       if {$tkVersion >= 3.0} {
  1662.         .fsBox.file.file icursor end
  1663.       } {
  1664.         .fsBox.file.file cursor end
  1665.       }
  1666.       focus .fsBox.file.file
  1667.     }
  1668.   }
  1669. }
  1670.  
  1671.  
  1672. # Procedure: FSBoxFSShow
  1673. proc FSBoxFSShow { fsBoxPath fsBoxPattern fsBoxAll} {
  1674. # xf ignore me 6
  1675.   global fsBox
  1676.  
  1677.   set tmpButtonOpt ""
  1678.   if {"$fsBox(activeBackground)" != ""} {
  1679.     append tmpButtonOpt "-activebackground \"$fsBox(activeBackground)\" "
  1680.   }
  1681.   if {"$fsBox(activeForeground)" != ""} {
  1682.     append tmpButtonOpt "-activeforeground \"$fsBox(activeForeground)\" "
  1683.   }
  1684.   if {"$fsBox(background)" != ""} {
  1685.     append tmpButtonOpt "-background \"$fsBox(background)\" "
  1686.   }
  1687.   if {"$fsBox(font)" != ""} {
  1688.     append tmpButtonOpt "-font \"$fsBox(font)\" "
  1689.   }
  1690.   if {"$fsBox(foreground)" != ""} {
  1691.     append tmpButtonOpt "-foreground \"$fsBox(foreground)\" "
  1692.   }
  1693.  
  1694.   set fsBox(pattern) $fsBoxPattern
  1695.   if {[file exists $fsBoxPath] && [file readable $fsBoxPath] &&
  1696.       [IsADir $fsBoxPath]} {
  1697.     set fsBox(internalPath) $fsBoxPath
  1698.   } {
  1699.     if {[file exists $fsBoxPath] && [file readable $fsBoxPath] &&
  1700.         [IsAFile $fsBoxPath]} {
  1701.       set fsBox(internalPath) [file dirname $fsBoxPath]
  1702.       .fsBox.file.file delete 0 end
  1703.       .fsBox.file.file insert 0 [file tail $fsBoxPath]
  1704.       set fsBoxPath $fsBox(internalPath)
  1705.     } {
  1706.       while {"$fsBoxPath" != "" && "$fsBoxPath" != "/" &&
  1707.              ![file isdirectory $fsBoxPath]} {
  1708.         set fsBox(internalPath) [file dirname $fsBoxPath]
  1709.          set fsBoxPath $fsBox(internalPath)
  1710.       }
  1711.     }
  1712.   }
  1713.   if {"$fsBoxPath" == ""} {
  1714.     set fsBoxPath "/"
  1715.     set fsBox(internalPath) "/"
  1716.   }
  1717.   .fsBox.path.path delete 0 end
  1718.   .fsBox.path.path insert 0 $fsBox(internalPath)
  1719.  
  1720.   if {[.fsBox.files.files size] > 0} {
  1721.     .fsBox.files.files delete 0 end
  1722.   }
  1723.   if {$fsBoxAll} {
  1724.     if {[catch "exec ls -F -a $fsBoxPath" fsBoxResult]} {
  1725.       puts stderr "$fsBoxResult"
  1726.     }
  1727.   } {
  1728.     if {[catch "exec ls -F $fsBoxPath" fsBoxResult]} {
  1729.       puts stderr "$fsBoxResult"
  1730.     }
  1731.   }
  1732.   set fsBoxElementList [lsort $fsBoxResult]
  1733.  
  1734.   foreach fsBoxCounter [winfo children .fsBox.pattern.patterns.patterns] {
  1735.     if {[string length [info commands XFDestroy]] > 0} {
  1736.       catch {XFDestroy $fsBoxCounter}
  1737.     } {
  1738.       catch {destroy $fsBoxCounter}
  1739.     }
  1740.   }
  1741.   menu .fsBox.pattern.patterns.patterns.menu
  1742.   catch ".fsBox.pattern.patterns.patterns.menu config $tmpButtonOpt"
  1743.  
  1744.   if {$fsBox(extensions)} {
  1745.     .fsBox.pattern.patterns.patterns.menu add command  -label "*"  -command {
  1746.         global fsBox
  1747.         set fsBox(pattern) "*"
  1748.         .fsBox.pattern.pattern delete 0 end
  1749.         .fsBox.pattern.pattern insert 0 $fsBox(pattern)
  1750.         FSBoxFSShow [.fsBox.path.path get] $fsBox(pattern)  $fsBox(all)}
  1751.   }
  1752.  
  1753.   if {"$fsBoxPath" != "/"} {
  1754.     .fsBox.files.files insert end "../"
  1755.   }
  1756.   foreach fsBoxCounter $fsBoxElementList {
  1757.     if {[string match $fsBoxPattern $fsBoxCounter] ||
  1758.         [IsADir [string trimright $fsBoxPath/$fsBoxCounter "/@"]]} {
  1759.       if {"$fsBoxCounter" != "../" &&
  1760.           "$fsBoxCounter" != "./"} {
  1761.         .fsBox.files.files insert end $fsBoxCounter
  1762.       }
  1763.     }
  1764.  
  1765.     if {$fsBox(extensions)} {
  1766.       catch "file rootname $fsBoxCounter" fsBoxRootName
  1767.       catch "file extension $fsBoxCounter" fsBoxExtension
  1768.       set fsBoxExtension [string trimright $fsBoxExtension "/*@"]
  1769.       if {"$fsBoxExtension" != "" && "$fsBoxRootName" != ""} {
  1770.         set fsBoxInsert 1
  1771.         set fsBoxLast [.fsBox.pattern.patterns.patterns.menu index last]
  1772.         for {set fsBoxCounter1 0} {$fsBoxCounter1 <= $fsBoxLast} {incr fsBoxCounter1 1} {
  1773.           if {"*$fsBoxExtension" ==  "[lindex [.fsBox.pattern.patterns.patterns.menu entryconfigure  $fsBoxCounter1 -label] 4]"} {
  1774.             set fsBoxInsert 0
  1775.           }
  1776.         }
  1777.     if {$fsBoxInsert} {
  1778.           .fsBox.pattern.patterns.patterns.menu add command  -label "*$fsBoxExtension"  -command "
  1779.               global fsBox
  1780.               set fsBox(pattern) \"*$fsBoxExtension\"
  1781.               .fsBox.pattern.pattern delete 0 end
  1782.               .fsBox.pattern.pattern insert 0 \$fsBox(pattern)
  1783.               FSBoxFSShow \[.fsBox.path.path get\] \$fsBox(pattern)  \$fsBox(all)"
  1784.         }
  1785.       }
  1786.     }
  1787.   }
  1788.   if {$fsBox(extensions)} {
  1789.     .fsBox.pattern.patterns.patterns.menu add separator
  1790.   }
  1791.   if {$fsBox(extensions) || 
  1792.       "[.fsBox.pattern.patterns.patterns.menu index last]" == "none"} {
  1793.     .fsBox.pattern.patterns.patterns.menu add checkbutton  -label "Scan extensions"  -variable "fsBox(extensions)"  -command {
  1794.         global fsBox
  1795.         FSBoxFSShow [.fsBox.path.path get]  [.fsBox.pattern.pattern get] $fsBox(all)}
  1796.   }
  1797. }
  1798.  
  1799.  
  1800. # Procedure: FdInList
  1801. proc FdInList { listWidget {fileInFile ""}} {
  1802. # xf ignore me 5
  1803. ##########
  1804. # Procedure: FdInList
  1805. # Description: fill a list with the contents of a filedescriptor
  1806. # Arguments: listWidget - the widget
  1807. #            {fileInFile} - a filedescriptor to read. The descriptor
  1808. #                           is closed after reading
  1809. # Returns: none
  1810. # Sideeffects: the list widget is filled
  1811. # Notes: there exists also a function called:
  1812. #          FileInList - to open and read a file automatically
  1813. ##########
  1814.  
  1815.   # check file existance
  1816.   if {"$fileInFile" == ""} {
  1817.     puts stderr "no filedescriptor specified"
  1818.     return
  1819.   }
  1820.  
  1821.   set listValue [read $fileInFile]
  1822.   close $fileInFile
  1823.   foreach fileLine [split $listValue "\n"] {
  1824.     $listWidget insert end $fileLine
  1825.   }
  1826. }
  1827.  
  1828.  
  1829. # Procedure: FdInText
  1830. proc FdInText { textWidget {fileInFile ""}} {
  1831. # xf ignore me 5
  1832. ##########
  1833. # Procedure: FdInText
  1834. # Description: fill a text with the contents of a filedescriptor
  1835. # Arguments: textWidget - the widget
  1836. #            {fileInFile} - a filedescriptor to read. The descriptor
  1837. #                           is closed after reading
  1838. # Returns: none
  1839. # Sideeffects: the text widget is filled
  1840. # Notes: there exists also a function called:
  1841. #          FileInText - to open and read a file automatically
  1842. ##########
  1843.  
  1844.   # check file existance
  1845.   if {"$fileInFile" == ""} {
  1846.     puts stderr "no filedescriptor specified"
  1847.     return
  1848.   }
  1849.  
  1850.   set textValue [read $fileInFile]
  1851.   $textWidget insert end "$textValue"
  1852.   close $fileInFile
  1853. }
  1854.  
  1855.  
  1856. # Procedure: FileInList
  1857. proc FileInList { listWidget {fileName ""}} {
  1858. # xf ignore me 5
  1859. ##########
  1860. # Procedure: FileInList
  1861. # Description: fill a list with the contents of the file
  1862. # Arguments: listWidget - the widget
  1863. #            {fileName} - filename to read
  1864. # Returns: none
  1865. # Sideeffects: the list widget is filled
  1866. # Notes: there exists also a function called:
  1867. #          FdInList - to read from an already opened filedescriptor
  1868. ##########
  1869.  
  1870.   # check file existance
  1871.   if {"$fileName" == ""} {
  1872.     puts stderr "no filename specified"
  1873.     return
  1874.   }
  1875.   if {[catch "open $fileName r" fileInFile]} {
  1876.     puts stderr "$fileInFile"
  1877.     return
  1878.   }
  1879.  
  1880.   set listValue [read $fileInFile]
  1881.   close $fileInFile
  1882.   foreach fileLine [split $listValue "\n"] {
  1883.     $listWidget insert end $fileLine
  1884.   }
  1885. }
  1886.  
  1887.  
  1888. # Procedure: FileInText
  1889. proc FileInText { textWidget {fileName ""}} {
  1890. # xf ignore me 5
  1891. ##########
  1892. # Procedure: FileInText
  1893. # Description: fill a text with the contents of the file
  1894. # Arguments: textWidget - the widget
  1895. #            {fileName} - filename to read
  1896. # Returns: none
  1897. # Sideeffects: the text widget is filled
  1898. # Notes: there exists also a function called:
  1899. #          FdInText - to read from an already opened filedescriptor
  1900. ##########
  1901.  
  1902.   # check file existance
  1903.   if {"$fileName" == ""} {
  1904.     puts stderr "no filename specified"
  1905.     return
  1906.   }
  1907.   if {[catch "open $fileName r" fileInFile]} {
  1908.     puts stderr "$fileInFile"
  1909.     return
  1910.   }
  1911.  
  1912.   set textValue [read $fileInFile]
  1913.   $textWidget insert end "$textValue"
  1914.   close $fileInFile
  1915. }
  1916.  
  1917.  
  1918. # Procedure: ForgetWindow
  1919. proc ForgetWindow { args} {
  1920.     foreach i $args    {
  1921.         pack forget $i
  1922.     }
  1923. }
  1924.  
  1925.  
  1926. # Procedure: InputBoxInternal
  1927. proc InputBoxInternal { inputBoxMessage inputBoxCommandOk inputBoxCommandCancel inputBoxGeometry inputBoxTitle lineNum} {
  1928. # xf ignore me 6
  1929.   global inputBox
  1930.  
  1931.   set tmpButtonOpt ""
  1932.   set tmpFrameOpt ""
  1933.   set tmpMessageOpt ""
  1934.   set tmpScaleOpt ""
  1935.   set tmpScrollOpt ""
  1936.   if {"$inputBox(activeBackground)" != ""} {
  1937.     append tmpButtonOpt "-activebackground \"$inputBox(activeBackground)\" "
  1938.   }
  1939.   if {"$inputBox(activeForeground)" != ""} {
  1940.     append tmpButtonOpt "-activeforeground \"$inputBox(activeForeground)\" "
  1941.   }
  1942.   if {"$inputBox(background)" != ""} {
  1943.     append tmpButtonOpt "-background \"$inputBox(background)\" "
  1944.     append tmpFrameOpt "-background \"$inputBox(background)\" "
  1945.     append tmpMessageOpt "-background \"$inputBox(background)\" "
  1946.   }
  1947.   if {"$inputBox(font)" != ""} {
  1948.     append tmpButtonOpt "-font \"$inputBox(font)\" "
  1949.     append tmpMessageOpt "-font \"$inputBox(font)\" "
  1950.   }
  1951.   if {"$inputBox(foreground)" != ""} {
  1952.     append tmpButtonOpt "-foreground \"$inputBox(foreground)\" "
  1953.     append tmpMessageOpt "-foreground \"$inputBox(foreground)\" "
  1954.   }
  1955.   if {"$inputBox(scrollActiveForeground)" != ""} {
  1956.     append tmpScrollOpt "-activeforeground \"$inputBox(scrollActiveForeground)\" "
  1957.   }
  1958.   if {"$inputBox(scrollBackground)" != ""} {
  1959.     append tmpScrollOpt "-background \"$inputBox(scrollBackground)\" "
  1960.   }
  1961.   if {"$inputBox(scrollForeground)" != ""} {
  1962.     append tmpScrollOpt "-foreground \"$inputBox(scrollForeground)\" "
  1963.   }
  1964.  
  1965.   # start build of toplevel
  1966.   if {"[info commands XFDestroy]" != ""} {
  1967.     catch {XFDestroy $inputBox(toplevelName)}
  1968.   } {
  1969.     catch {destroy $inputBox(toplevelName)}
  1970.   }
  1971.   toplevel $inputBox(toplevelName)  -borderwidth 0
  1972.   catch "$inputBox(toplevelName) config $tmpFrameOpt"
  1973.   if {[catch "wm geometry $inputBox(toplevelName) $inputBoxGeometry"]} {
  1974.     wm geometry $inputBox(toplevelName) 350x150
  1975.   }
  1976.   wm title $inputBox(toplevelName) $inputBoxTitle
  1977.   wm maxsize $inputBox(toplevelName) 1000 1000
  1978.   wm minsize $inputBox(toplevelName) 100 100
  1979.   # end build of toplevel
  1980.  
  1981.   message $inputBox(toplevelName).message1  -anchor "$inputBox(anchor)"  -justify "$inputBox(justify)"  -relief raised  -text "$inputBoxMessage"
  1982.   catch "$inputBox(toplevelName).message1 config $tmpMessageOpt"
  1983.  
  1984.   set xfTmpWidth  [string range $inputBoxGeometry 0 [expr [string first x $inputBoxGeometry]-1]]
  1985.   if {"$xfTmpWidth" != ""} {
  1986.     # set message size
  1987.     catch "$inputBox(toplevelName).message1 configure  -width [expr $xfTmpWidth-10]"
  1988.   } {
  1989.     $inputBox(toplevelName).message1 configure  -aspect 1500
  1990.   }
  1991.  
  1992.   frame $inputBox(toplevelName).topmenubar  -borderwidth 0  -relief raised
  1993.   catch "$inputBox(toplevelName).topmenubar config $tmpFrameOpt"
  1994.  
  1995.   frame $inputBox(toplevelName).frame1  -borderwidth 0  -relief raised
  1996.   catch "$inputBox(toplevelName).frame1 config $tmpFrameOpt"
  1997.  
  1998.   if {$lineNum == 1} {
  1999.     scrollbar $inputBox(toplevelName).frame1.hscroll  -orient "horizontal"  -relief raised  -command "$inputBox(toplevelName).frame1.input view"
  2000.     catch "$inputBox(toplevelName).frame1.hscroll config $tmpScrollOpt"
  2001.  
  2002.     entry $inputBox(toplevelName).frame1.input  -relief raised  -scrollcommand "$inputBox(toplevelName).frame1.hscroll set"
  2003.     catch "$inputBox(toplevelName).frame1.input config $tmpMessageOpt"
  2004.  
  2005.     $inputBox(toplevelName).frame1.input insert 0  $inputBox($inputBox(toplevelName),inputOne)
  2006.     
  2007.     # bindings
  2008.     bind $inputBox(toplevelName).frame1.input <Return> "
  2009.       global inputBox
  2010.       set inputBox($inputBox(toplevelName),inputOne) \[$inputBox(toplevelName).frame1.input get\]
  2011.       if {\"\[info commands XFDestroy\]\" != \"\"} {
  2012.         catch {XFDestroy $inputBox(toplevelName)}
  2013.       } {
  2014.         catch {destroy $inputBox(toplevelName)}
  2015.       }
  2016.       $inputBoxCommandOk"
  2017.     
  2018.     # packing
  2019.     pack append $inputBox(toplevelName).frame1  $inputBox(toplevelName).frame1.hscroll {bottom fill}  $inputBox(toplevelName).frame1.input {top fill expand}
  2020.   } {
  2021.     text $inputBox(toplevelName).frame1.input  -relief raised  -wrap none  -borderwidth 2  -yscrollcommand "$inputBox(toplevelName).frame1.vscroll set"
  2022.     catch "$inputBox(toplevelName).frame1.input config $tmpMessageOpt"
  2023.  
  2024.     scrollbar $inputBox(toplevelName).frame1.vscroll  -relief raised  -command "$inputBox(toplevelName).frame1.input yview"
  2025.     catch "$inputBox(toplevelName).frame1.vscroll config $tmpScrollOpt"
  2026.  
  2027.     $inputBox(toplevelName).frame1.input insert 1.0  $inputBox($inputBox(toplevelName),inputMulti)
  2028.  
  2029.     # bindings
  2030.     bind $inputBox(toplevelName).frame1.input <Control-Return> "
  2031.       global inputBox
  2032.       set inputBox($inputBox(toplevelName),inputMulti) \[$inputBox(toplevelName).frame1.input get 1.0 end\]
  2033.       if {\"\[info commands XFDestroy\]\" != \"\"} {
  2034.         catch {XFDestroy $inputBox(toplevelName)}
  2035.       } {
  2036.         catch {destroy $inputBox(toplevelName)}
  2037.       }
  2038.       $inputBoxCommandOk"
  2039.     bind $inputBox(toplevelName).frame1.input <Meta-Return> "
  2040.       global inputBox
  2041.       set inputBox($inputBox(toplevelName),inputMulti) \[$inputBox(toplevelName).frame1.input get 1.0 end\]
  2042.       if {\"\[info commands XFDestroy\]\" != \"\"} {
  2043.         catch {XFDestroy $inputBox(toplevelName)}
  2044.       } {
  2045.         catch {destroy $inputBox(toplevelName)}
  2046.       }
  2047.       $inputBoxCommandOk"
  2048.  
  2049.     # packing
  2050.     pack append $inputBox(toplevelName).frame1  $inputBox(toplevelName).frame1.vscroll "$inputBox(scrollSide) filly"  $inputBox(toplevelName).frame1.input {left fill expand}
  2051.   }
  2052.   
  2053.   button $inputBox(toplevelName).topmenubar.okButton  -text "OK"  -command "
  2054.       global inputBox
  2055.       if {$lineNum == 1} {
  2056.         set inputBox($inputBox(toplevelName),inputOne) \[$inputBox(toplevelName).frame1.input get\]
  2057.       } {
  2058.         set inputBox($inputBox(toplevelName),inputMulti) \[$inputBox(toplevelName).frame1.input get 1.0 end\]
  2059.       }
  2060.       if {\"\[info commands XFDestroy\]\" != \"\"} {
  2061.         catch {XFDestroy $inputBox(toplevelName)}
  2062.       } {
  2063.         catch {destroy $inputBox(toplevelName)}
  2064.       }
  2065.       $inputBoxCommandOk"
  2066.   catch "$inputBox(toplevelName).topmenubar.okButton config $tmpButtonOpt"
  2067.  
  2068.   button $inputBox(toplevelName).topmenubar.button1  -text "Cancel"  -command "
  2069.       global inputBox
  2070.       if {$lineNum == 1} {
  2071.         set inputBox($inputBox(toplevelName),inputOne) \"\"
  2072.       } {
  2073.         set inputBox($inputBox(toplevelName),inputMulti) \"\"
  2074.       }
  2075.       if {\"\[info commands XFDestroy\]\" != \"\"} {
  2076.         catch {XFDestroy $inputBox(toplevelName)}
  2077.       } {
  2078.         catch {destroy $inputBox(toplevelName)}
  2079.       }
  2080.       $inputBoxCommandCancel"
  2081.   catch "$inputBox(toplevelName).topmenubar.button1 config $tmpButtonOpt"
  2082.  
  2083.   pack append $inputBox(toplevelName).topmenubar  $inputBox(toplevelName).topmenubar.okButton {left fill expand}  $inputBox(toplevelName).topmenubar.button1 {left fill expand}
  2084.  
  2085.   pack append $inputBox(toplevelName)  $inputBox(toplevelName).topmenubar {bottom fill}  $inputBox(toplevelName).frame1 {bottom fill expand}  $inputBox(toplevelName).message1 {top fill}
  2086. }
  2087.  
  2088.  
  2089. # Procedure: IsADir
  2090. proc IsADir { pathName} {
  2091. # xf ignore me 5
  2092. ##########
  2093. # Procedure: IsADir
  2094. # Description: check if name is a directory (including symbolic links)
  2095. # Arguments: pathName - the path to check
  2096. # Returns: 1 if its a directory, otherwise 0
  2097. # Sideeffects: none
  2098. ##########
  2099.  
  2100.   if {[file isdirectory $pathName]} {
  2101.     return 1
  2102.   } {
  2103.     catch "file type $pathName" fileType
  2104.     if {"$fileType" == "link"} {
  2105.       if {[catch "file readlink $pathName" linkName]} {
  2106.         return 0
  2107.       }
  2108.       catch "file type $linkName" fileType
  2109.       while {"$fileType" == "link"} {
  2110.         if {[catch "file readlink $linkName" linkName]} {
  2111.           return 0
  2112.         }
  2113.         catch "file type $linkName" fileType
  2114.       }
  2115.       return [file isdirectory $linkName]
  2116.     }
  2117.   }
  2118.   return 0
  2119. }
  2120.  
  2121.  
  2122. # Procedure: IsAFile
  2123. proc IsAFile { fileName} {
  2124. # xf ignore me 5
  2125. ##########
  2126. # Procedure: IsAFile
  2127. # Description: check if filename is a file (including symbolic links)
  2128. # Arguments: fileName - the filename to check
  2129. # Returns: 1 if its a file, otherwise 0
  2130. # Sideeffects: none
  2131. ##########
  2132.  
  2133.   if {[file isfile $fileName]} {
  2134.     return 1
  2135.   } {
  2136.     catch "file type $fileName" fileType
  2137.     if {"$fileType" == "link"} {
  2138.       if {[catch "file readlink $fileName" linkName]} {
  2139.         return 0
  2140.       }
  2141.       catch "file type $linkName" fileType
  2142.       while {"$fileType" == "link"} {
  2143.         if {[catch "file readlink $linkName" linkName]} {
  2144.           return 0
  2145.         }
  2146.         catch "file type $linkName" fileType
  2147.       }
  2148.       return [file isfile $linkName]
  2149.     }
  2150.   }
  2151.   return 0
  2152. }
  2153.  
  2154.  
  2155. # Procedure: IsASymlink
  2156. proc IsASymlink { fileName} {
  2157. # xf ignore me 5
  2158. ##########
  2159. # Procedure: IsASymlink
  2160. # Description: check if filename is a symbolic link
  2161. # Arguments: fileName - the path/filename to check
  2162. # Returns: none
  2163. # Sideeffects: none
  2164. ##########
  2165.  
  2166.   catch "file type $fileName" fileType
  2167.   if {"$fileType" == "link"} {
  2168.     return 1
  2169.   }
  2170.   return 0
  2171. }
  2172.  
  2173.  
  2174. # Procedure: TextBox
  2175. proc TextBox { {textBoxMessage "Text message"} {textBoxCommand ""} {textBoxGeometry "350x150"} {textBoxTitle "Text box"} args} {
  2176. # xf ignore me 5
  2177. ##########
  2178. # Procedure: TextBox
  2179. # Description: show text box
  2180. # Arguments: {textBoxMessage} - the text to display
  2181. #            {textBoxCommand} - the command to call after ok
  2182. #            {textBoxGeometry} - the geometry for the window
  2183. #            {textBoxTitle} - the title for the window
  2184. #            {args} - labels of buttons
  2185. # Returns: The number of the selected button, or nothing
  2186. # Sideeffects: none
  2187. # Notes: there exist also functions called:
  2188. #          TextBoxFile - to open and read a file automatically
  2189. #          TextBoxFd - to read from an already opened filedescriptor
  2190. ##########
  2191. #
  2192. # global textBox(activeBackground) - active background color
  2193. # global textBox(activeForeground) - active foreground color
  2194. # global textBox(background) - background color
  2195. # global textBox(font) - text font
  2196. # global textBox(foreground) - foreground color
  2197. # global textBox(scrollActiveForeground) - scrollbar active background color
  2198. # global textBox(scrollBackground) - scrollbar background color
  2199. # global textBox(scrollForeground) - scrollbar foreground color
  2200. # global textBox(scrollSide) - side where scrollbar is located
  2201.  
  2202.   global textBox
  2203.         set textBox(activeBackground) "#bfbfbf"
  2204.         set textBox(activeForeground) "black"
  2205.     set textBox(background) "#bfbfbf"
  2206.     set textBox(scrollBackground) "#bfbfbf"
  2207.     set textBox(scrollForeground) "#bfbfbf"
  2208.     set textBox(scrollActiveForeground) "#bfbfbf"
  2209.     set textBox(scrollSide) "right"
  2210.  
  2211.   # show text box
  2212.   if {[llength $args] > 0} {
  2213.     eval TextBoxInternal "\{$textBoxMessage\}" "\{$textBoxCommand\}" "\{$textBoxGeometry\}" "\{$textBoxTitle\}" $args
  2214.   } {
  2215.     TextBoxInternal $textBoxMessage $textBoxCommand $textBoxGeometry $textBoxTitle
  2216.   }
  2217.  
  2218.   if {[llength $args] > 0} {
  2219.     # wait for the box to be destroyed
  2220.     update idletask
  2221.     grab $textBox(toplevelName)
  2222.     tkwait window $textBox(toplevelName)
  2223.  
  2224.     return $textBox(button)
  2225.   }
  2226. }
  2227.  
  2228.  
  2229. # Procedure: TextBoxFd
  2230. proc TextBoxFd { {textBoxInFile ""} {textBoxCommand ""} {textBoxGeometry "350x150"} {textBoxTitle "Text box"} args} {
  2231. # xf ignore me 5
  2232. ##########
  2233. # Procedure: TextBoxFd
  2234. # Description: show text box containing a filedescriptor
  2235. # Arguments: {textBoxInFile} - a filedescriptor to read. The descriptor
  2236. #                              is closed after reading
  2237. #            {textBoxCommand} - the command to call after ok
  2238. #            {textBoxGeometry} - the geometry for the window
  2239. #            {textBoxTitle} - the title for the window
  2240. #            {args} - labels of buttons
  2241. # Returns: The number of the selected button, ot nothing
  2242. # Sideeffects: none
  2243. # Notes: there exist also functions called:
  2244. #          TextBox - to display a passed string
  2245. #          TextBoxFile - to open and read a file automatically
  2246. ##########
  2247. #
  2248. # global textBox(activeBackground) - active background color
  2249. # global textBox(activeForeground) - active foreground color
  2250. # global textBox(background) - background color
  2251. # global textBox(font) - text font
  2252. # global textBox(foreground) - foreground color
  2253. # global textBox(scrollActiveForeground) - scrollbar active background color
  2254. # global textBox(scrollBackground) - scrollbar background color
  2255. # global textBox(scrollForeground) - scrollbar foreground color
  2256. # global textBox(scrollSide) - side where scrollbar is located
  2257.  
  2258.   global textBox
  2259.  
  2260.   # check file existance
  2261.   if {"$textBoxInFile" == ""} {
  2262.     puts stderr "No filedescriptor specified"
  2263.     return
  2264.   }
  2265.  
  2266.   set textBoxMessage [read $textBoxInFile]
  2267.   close $textBoxInFile
  2268.  
  2269.   # show text box
  2270.   if {[llength $args] > 0} {
  2271.     eval TextBoxInternal "\{$textBoxMessage\}" "\{$textBoxCommand\}" "\{$textBoxGeometry\}" "\{$textBoxTitle\}" $args
  2272.   } {
  2273.     TextBoxInternal $textBoxMessage $textBoxCommand $textBoxGeometry $textBoxTitle
  2274.   }
  2275.  
  2276.   if {[llength $args] > 0} {
  2277.     # wait for the box to be destroyed
  2278.     update idletask
  2279.     grab $textBox(toplevelName)
  2280.     tkwait window $textBox(toplevelName)
  2281.  
  2282.     return $textBox(button)
  2283.   }
  2284. }
  2285.  
  2286.  
  2287. # Procedure: TextBoxFile
  2288. proc TextBoxFile { {textBoxFile ""} {textBoxCommand ""} {textBoxGeometry "350x150"} {textBoxTitle "Text box"} args} {
  2289. # xf ignore me 5
  2290. ##########
  2291. # Procedure: TextBoxFile
  2292. # Description: show text box containing a file
  2293. # Arguments: {textBoxFile} - filename to read
  2294. #            {textBoxCommand} - the command to call after ok
  2295. #            {textBoxGeometry} - the geometry for the window
  2296. #            {textBoxTitle} - the title for the window
  2297. #            {args} - labels of buttons
  2298. # Returns: The number of the selected button, ot nothing
  2299. # Sideeffects: none
  2300. # Notes: there exist also functions called:
  2301. #          TextBox - to display a passed string
  2302. #          TextBoxFd - to read from an already opened filedescriptor
  2303. ##########
  2304. #
  2305. # global textBox(activeBackground) - active background color
  2306. # global textBox(activeForeground) - active foreground color
  2307. # global textBox(background) - background color
  2308. # global textBox(font) - text font
  2309. # global textBox(foreground) - foreground color
  2310. # global textBox(scrollActiveForeground) - scrollbar active background color
  2311. # global textBox(scrollBackground) - scrollbar background color
  2312. # global textBox(scrollForeground) - scrollbar foreground color
  2313. # global textBox(scrollSide) - side where scrollbar is located
  2314.  
  2315.   global textBox
  2316.  
  2317.   # check file existance
  2318.   if {"$textBoxFile" == ""} {
  2319.     puts stderr "No filename specified"
  2320.     return
  2321.   }
  2322.  
  2323.   if {[catch "open $textBoxFile r" textBoxInFile]} {
  2324.     puts stderr "$textBoxInFile"
  2325.     return
  2326.   }
  2327.  
  2328.   set textBoxMessage [read $textBoxInFile]
  2329.   close $textBoxInFile
  2330.  
  2331.   # show text box
  2332.   if {[llength $args] > 0} {
  2333.     eval TextBoxInternal "\{$textBoxMessage\}" "\{$textBoxCommand\}" "\{$textBoxGeometry\}" "\{$textBoxTitle\}" $args
  2334.   } {
  2335.     TextBoxInternal $textBoxMessage $textBoxCommand $textBoxGeometry $textBoxTitle
  2336.   }
  2337.  
  2338.   if {[llength $args] > 0} {
  2339.     # wait for the box to be destroyed
  2340.     update idletask
  2341.     grab $textBox(toplevelName)
  2342.     tkwait window $textBox(toplevelName)
  2343.  
  2344.     return $textBox(button)
  2345.   }
  2346. }
  2347.  
  2348.  
  2349. # Procedure: TextBoxInternal
  2350. proc TextBoxInternal { textBoxMessage textBoxCommand textBoxGeometry textBoxTitle args} {
  2351. # xf ignore me 6
  2352.   global textBox
  2353.  
  2354.   set tmpButtonOpt ""
  2355.   set tmpFrameOpt ""
  2356.   set tmpMessageOpt ""
  2357.   set tmpScrollOpt ""
  2358.   if {"$textBox(activeBackground)" != ""} {
  2359.     append tmpButtonOpt "-activebackground \"$textBox(activeBackground)\" "
  2360.   }
  2361.   if {"$textBox(activeForeground)" != ""} {
  2362.     append tmpButtonOpt "-activeforeground \"$textBox(activeForeground)\" "
  2363.   }
  2364.   if {"$textBox(background)" != ""} {
  2365.     append tmpButtonOpt "-background \"$textBox(background)\" "
  2366.     append tmpFrameOpt "-background \"$textBox(background)\" "
  2367.     append tmpMessageOpt "-background \"$textBox(background)\" "
  2368.   }
  2369.   if {"$textBox(font)" != ""} {
  2370.     append tmpButtonOpt "-font \"$textBox(font)\" "
  2371.     append tmpMessageOpt "-font \"$textBox(font)\" "
  2372.   }
  2373.   if {"$textBox(foreground)" != ""} {
  2374.     append tmpButtonOpt "-foreground \"$textBox(foreground)\" "
  2375.     append tmpMessageOpt "-foreground \"$textBox(foreground)\" "
  2376.   }
  2377.   if {"$textBox(scrollActiveForeground)" != ""} {
  2378.     append tmpScrollOpt "-activeforeground \"$textBox(scrollActiveForeground)\" "
  2379.   }
  2380.   if {"$textBox(scrollBackground)" != ""} {
  2381.     append tmpScrollOpt "-background \"$textBox(scrollBackground)\" "
  2382.   }
  2383.   if {"$textBox(scrollForeground)" != ""} {
  2384.     append tmpScrollOpt "-foreground \"$textBox(scrollForeground)\" "
  2385.   }
  2386.  
  2387.   # start build of toplevel
  2388.   if {"[info commands XFDestroy]" != ""} {
  2389.     catch {XFDestroy $textBox(toplevelName)}
  2390.   } {
  2391.     catch {destroy $textBox(toplevelName)}
  2392.   }
  2393.   toplevel $textBox(toplevelName)  -borderwidth 0
  2394.   catch "$textBox(toplevelName) config $tmpFrameOpt"
  2395.   if {[catch "wm geometry $textBox(toplevelName) $textBoxGeometry"]} {
  2396.     wm geometry $textBox(toplevelName) 350x150
  2397.   }
  2398.   wm title $textBox(toplevelName) $textBoxTitle
  2399.   wm maxsize $textBox(toplevelName) 1000 1000
  2400.   wm minsize $textBox(toplevelName) 100 100
  2401.   # end build of toplevel
  2402.  
  2403.   frame $textBox(toplevelName).topmenubar  -borderwidth 0  -relief raised
  2404.   catch "$textBox(toplevelName).topmenubar config $tmpFrameOpt"
  2405.  
  2406.   text $textBox(toplevelName).topmenubar.text1  -relief raised  -wrap none  -borderwidth 2  -yscrollcommand "$textBox(toplevelName).topmenubar.vscroll set"
  2407.   catch "$textBox(toplevelName).topmenubar.text1 config $tmpMessageOpt"
  2408.  
  2409.   scrollbar $textBox(toplevelName).topmenubar.vscroll  -relief raised  -command "$textBox(toplevelName).topmenubar.text1 yview"
  2410.   catch "$textBox(toplevelName).topmenubar.vscroll config $tmpScrollOpt"
  2411.  
  2412.   frame $textBox(toplevelName).frame1  -borderwidth 0  -relief raised
  2413.   catch "$textBox(toplevelName).frame1 config $tmpFrameOpt"
  2414.  
  2415.   set textBoxCounter 0
  2416.   set buttonNum [llength $args]
  2417.  
  2418.   if {$buttonNum > 0} {
  2419.     while {$textBoxCounter < $buttonNum} {
  2420.       button $textBox(toplevelName).frame1.button$textBoxCounter  -text "[lindex $args $textBoxCounter]"  -command "
  2421.           global textBox
  2422.           set textBox(button) $textBoxCounter
  2423.           set textBox(contents) \[$textBox(toplevelName).topmenubar.text1 get 1.0 end\]
  2424.           if {\"\[info commands XFDestroy\]\" != \"\"} {
  2425.             catch {XFDestroy $textBox(toplevelName)}
  2426.           } {
  2427.             catch {destroy $textBox(toplevelName)}
  2428.           }"
  2429.       catch "$textBox(toplevelName).frame1.button$textBoxCounter config $tmpButtonOpt"
  2430.  
  2431.       pack append $textBox(toplevelName).frame1  $textBox(toplevelName).frame1.button$textBoxCounter {left fillx expand}
  2432.  
  2433.       incr textBoxCounter
  2434.     }
  2435.   } {
  2436.     button $textBox(toplevelName).frame1.button0  -text "OK"  -command "
  2437.         global textBox
  2438.         set textBox(button) 0
  2439.         set textBox(contents) \[$textBox(toplevelName).topmenubar.text1 get 1.0 end\]
  2440.         if {\"\[info commands XFDestroy\]\" != \"\"} {
  2441.           catch {XFDestroy $textBox(toplevelName)}
  2442.         } {
  2443.           catch {destroy $textBox(toplevelName)}
  2444.         }
  2445.         $textBoxCommand"
  2446.     catch "$textBox(toplevelName).frame1.button0 config $tmpButtonOpt"
  2447.  
  2448.     pack append $textBox(toplevelName).frame1  $textBox(toplevelName).frame1.button0 {left fillx expand}
  2449.   }
  2450.  
  2451.   $textBox(toplevelName).topmenubar.text1 insert end "$textBoxMessage"
  2452.  
  2453.   $textBox(toplevelName).topmenubar.text1 config  -state $textBox(state)
  2454.  
  2455.   # packing
  2456.   pack append $textBox(toplevelName).topmenubar  $textBox(toplevelName).topmenubar.vscroll "$textBox(scrollSide) filly"  $textBox(toplevelName).topmenubar.text1 {left fill expand}
  2457.   pack append $textBox(toplevelName)  $textBox(toplevelName).frame1 {bottom fill}  $textBox(toplevelName).topmenubar {top fill expand}
  2458. }
  2459.  
  2460.  
  2461. # Procedure: WriteVars
  2462. proc WriteVars { writeToFile} {
  2463.     global choosemethod packmethod writemethod formatalways verifyformat verifyalways verifywrite mnr mdens 
  2464.     set f1 [open $writeToFile w+]
  2465.         set setname [getsetname $setnameselection] 
  2466.     puts $f1 "export pre_choosemethod=$choosemethod"
  2467.     puts $f1 "export pre_packmethod=$packmethod"
  2468.     puts $f1 "export pre_writemethod=$writemethod"
  2469.     puts $f1 "export pre_mnr=$mnr"    
  2470.     puts $f1 "export pre_formatalways=$formatalways"
  2471.     puts $f1 "export pre_verifyformat=$verifyformat"
  2472.     puts $f1 "export pre_verifywrite=$verifywrite"
  2473.         puts $f1 "export pre_setname=$setname"
  2474.     puts $f1 "export mdens=$mdens"
  2475.     close $f1
  2476. }
  2477.  
  2478.  
  2479. # Procedure: fileselect.cancel.cmd
  2480. proc fileselect.cancel.cmd { w} {
  2481. # xf ignore me 6
  2482.     # puts stderr "Cancel"
  2483.     if {"[info commands XFDestroy]" != ""} {
  2484.         catch {XFDestroy $w}
  2485.     } {
  2486.         catch {destroy $w}
  2487.     }
  2488. }
  2489.  
  2490.  
  2491. # Procedure: fileselect.ok.cmd
  2492. proc fileselect.ok.cmd { w cmd} {
  2493. # xf ignore me 6
  2494.     global fileselect_entry fileselect_dirlabel fileselect_list 
  2495.     set selected [$fileselect_entry get]
  2496.  
  2497.     if {[file isdirectory $selected] != 0} {
  2498.     cd $selected
  2499.     set dir [exec pwd]
  2500.     eval $fileselect_dirlabel configure -text $dir
  2501.     eval $fileselect_entry delete 0 end
  2502.     eval $fileselect_list delete 0 end
  2503.     foreach i [exec ls -a $dir] {
  2504.         if {[string compare $i "."] != 0} {
  2505.         eval $fileselect_list insert end $i
  2506.         }
  2507.     }
  2508.     return
  2509.     }
  2510.  
  2511.     if {"[info commands XFDestroy]" != ""} {
  2512.         catch {XFDestroy $w}
  2513.     } {
  2514.         catch {destroy $w}
  2515.     }
  2516.     eval $cmd \"$selected\"
  2517. }
  2518.  
  2519.  
  2520. # Procedure: getsetname
  2521. proc getsetname { setnameselection} {
  2522.         global setnameselection
  2523.     set setstring [string trim $setnameselection \{\}] ; #get rid of the "{}'s
  2524.     set returnval [string trim [lrange $setstring 0 0]]
  2525.     return $returnval
  2526. }
  2527.  
  2528.  
  2529. # Procedure: lreplaceit
  2530. proc lreplaceit { list value newval} {
  2531.   set ix [lsearch -exact $list $value]
  2532.   if {$ix >= 0} {
  2533.     set newlist [lreplace $list $ix $ix $newval ]
  2534.     return [lreplaceit $newlist $value $newval ]
  2535.   } else {
  2536.     return $list
  2537.       }
  2538. }
  2539.  
  2540.  
  2541. # Procedure: opensetfilelist
  2542. proc opensetfilelist { setfilelistname} {
  2543.     set fd [open $setfilelistname w] 
  2544.     #pop the info into the file...
  2545.     puts $fd [exec /usr/lib/tbackup/bin/listsets]
  2546.     close $fd
  2547.     set fd [open $setfilelistname r]
  2548.     set alist [read $fd] ; #put the contents of the file in a list struct
  2549.     close $fd
  2550.     set fd [open $setfilelistname w]
  2551.     set setfilelist [join [lreplaceit [lreplaceit $alist # \-\-] \[END\] \n]]
  2552.     puts $fd $setfilelist
  2553.     close $fd
  2554.     set lengthofthislist [llength $setfilelist]
  2555.     return $lengthofthislist ; Want it to return # of lines!
  2556. }
  2557.  
  2558.  
  2559. # Internal procedures
  2560.  
  2561.  
  2562. # Procedure: Alias
  2563. if {"[info procs Alias]" == ""} {
  2564. proc Alias { args} {
  2565. # xf ignore me 7
  2566. ##########
  2567. # Procedure: Alias
  2568. # Description: establish an alias for a procedure
  2569. # Arguments: args - no argument means that a list of all aliases
  2570. #                   is returned. Otherwise the first parameter is
  2571. #                   the alias name, and the second parameter is
  2572. #                   the procedure that is aliased.
  2573. # Returns: nothing, the command that is bound to the alias or a
  2574. #          list of all aliases - command pairs. 
  2575. # Sideeffects: internalAliasList is updated, and the alias
  2576. #              proc is inserted
  2577. ##########
  2578.   global internalAliasList
  2579.  
  2580.   if {[llength $args] == 0} {
  2581.     return $internalAliasList
  2582.   } {
  2583.     if {[llength $args] == 1} {
  2584.       set xfTmpIndex [lsearch $internalAliasList "[lindex $args 0] *"]
  2585.       if {$xfTmpIndex != -1} {
  2586.         return [lindex [lindex $internalAliasList $xfTmpIndex] 1]
  2587.       }
  2588.     } {
  2589.       if {[llength $args] == 2} {
  2590.         eval "proc [lindex $args 0] {args} {#xf ignore me 4
  2591. return \[eval \"[lindex $args 1] \$args\"\]}"
  2592.         set xfTmpIndex [lsearch $internalAliasList "[lindex $args 0] *"]
  2593.         if {$xfTmpIndex != -1} {
  2594.           set internalAliasList [lreplace $internalAliasList $xfTmpIndex $xfTmpIndex "[lindex $args 0] [lindex $args 1]"]
  2595.         } {
  2596.           lappend internalAliasList "[lindex $args 0] [lindex $args 1]"
  2597.         }
  2598.       } {
  2599.         error "Alias: wrong number or args: $args"
  2600.       }
  2601.     }
  2602.   }
  2603. }
  2604. }
  2605.  
  2606.  
  2607. # Procedure: GetSelection
  2608. if {"[info procs GetSelection]" == ""} {
  2609. proc GetSelection {} {
  2610. # xf ignore me 7
  2611. ##########
  2612. # Procedure: GetSelection
  2613. # Description: get current selection
  2614. # Arguments: none
  2615. # Returns: none
  2616. # Sideeffects: none
  2617. ##########
  2618.  
  2619.   # the save way
  2620.   set xfSelection ""
  2621.   catch "selection get" xfSelection
  2622.   if {"$xfSelection" == "selection doesn't exist or form \"STRING\" not defined"} {
  2623.     return ""
  2624.   } {
  2625.     return $xfSelection
  2626.   }
  2627. }
  2628. }
  2629.  
  2630.  
  2631. # Procedure: MenuPopupAdd
  2632. if {"[info procs MenuPopupAdd]" == ""} {
  2633. proc MenuPopupAdd { xfW xfButton xfMenu {xfModifier ""} {xfCanvasTag ""}} {
  2634. # xf ignore me 7
  2635. # the popup menu handling is from (I already gave up with popup handling :-):
  2636. #
  2637. # Copyright 1991,1992 by James Noble.
  2638. # Everyone is granted permission to copy, modify and redistribute.
  2639. # This notice must be preserved on all copies or derivates.
  2640. #
  2641. ##########
  2642. # Procedure: MenuPopupAdd
  2643. # Description: attach a popup menu to widget
  2644. # Arguments: xfW - the widget
  2645. #            xfButton - the button we use
  2646. #            xfMenu - the menu to attach
  2647. #            {xfModifier} - a optional modifier
  2648. #            {xfCanvasTag} - a canvas tagOrId
  2649. # Returns: none
  2650. # Sideeffects: none
  2651. ##########
  2652.   global tk_popupPriv
  2653.  
  2654.   set tk_popupPriv($xfMenu,focus) ""
  2655.   set tk_popupPriv($xfMenu,grab) ""
  2656.   if {"$xfModifier" != ""} {
  2657.     set press "$xfModifier-"
  2658.     set motion "$xfModifier-"
  2659.     set release "Any-"
  2660.   } {
  2661.     set press ""
  2662.     set motion ""
  2663.     set release ""
  2664.   }
  2665.  
  2666.   bind $xfMenu "<${motion}B${xfButton}-Motion>"  "MenuPopupMotion $xfMenu %W %X %Y"
  2667.   bind $xfMenu "<${release}ButtonRelease-${xfButton}>"  "MenuPopupRelease $xfMenu %W"
  2668.   if {"$xfCanvasTag" == ""} {
  2669.     bind $xfW "<${press}ButtonPress-${xfButton}>"  "MenuPopupPost $xfMenu %X %Y"
  2670.     bind $xfW "<${release}ButtonRelease-${xfButton}>"  "MenuPopupRelease $xfMenu %W"
  2671.   } {
  2672.     $xfW bind $xfCanvasTag "<${press}ButtonPress-${xfButton}>"  "MenuPopupPost $xfMenu %X %Y"
  2673.     $xfW bind $xfCanvasTag "<${release}ButtonRelease-${xfButton}>"  "MenuPopupRelease $xfMenu %W"
  2674.   }
  2675. }
  2676. }
  2677.  
  2678.  
  2679. # Procedure: MenuPopupMotion
  2680. if {"[info procs MenuPopupMotion]" == ""} {
  2681. proc MenuPopupMotion { xfMenu xfW xfX xfY} {
  2682. # xf ignore me 7
  2683. ##########
  2684. # Procedure: MenuPopupMotion
  2685. # Description: handle the popup menu motion
  2686. # Arguments: xfMenu - the topmost menu
  2687. #            xfW - the menu
  2688. #            xfX - the root x coordinate
  2689. #            xfY - the root x coordinate
  2690. # Returns: none
  2691. # Sideeffects: none
  2692. ##########
  2693.   global tk_popupPriv
  2694.  
  2695.   if {"[info commands $xfW]" != "" && [winfo ismapped $xfW] &&
  2696.       "[winfo class $xfW]" == "Menu" &&
  2697.       [info exists tk_popupPriv($xfMenu,focus)] &&
  2698.       "$tk_popupPriv($xfMenu,focus)" != "" &&
  2699.       [info exists tk_popupPriv($xfMenu,grab)] &&
  2700.       "$tk_popupPriv($xfMenu,grab)" != ""} {
  2701.     set xfPopMinX [winfo rootx $xfW]
  2702.     set xfPopMaxX [expr $xfPopMinX+[winfo width $xfW]]
  2703.     if {$xfX >= $xfPopMinX && $xfX <= $xfPopMaxX} {
  2704.       $xfW activate @[expr $xfY-[winfo rooty $xfW]]
  2705.       if {![catch "$xfW entryconfig @[expr $xfY-[winfo rooty $xfW]] -menu" result]} {
  2706.         if {"[lindex $result 4]" != ""} {
  2707.           foreach binding [bind $xfMenu] {
  2708.             bind [lindex $result 4] $binding [bind $xfMenu $binding]
  2709.           }
  2710.         }
  2711.       }
  2712.     } {
  2713.       $xfW activate none
  2714.     }
  2715.   }
  2716. }
  2717. }
  2718.  
  2719.  
  2720. # Procedure: MenuPopupPost
  2721. if {"[info procs MenuPopupPost]" == ""} {
  2722. proc MenuPopupPost { xfMenu xfX xfY} {
  2723. # xf ignore me 7
  2724. ##########
  2725. # Procedure: MenuPopupPost
  2726. # Description: post the popup menu
  2727. # Arguments: xfMenu - the menu
  2728. #            xfX - the root x coordinate
  2729. #            xfY - the root x coordinate
  2730. # Returns: none
  2731. # Sideeffects: none
  2732. ##########
  2733.   global tk_popupPriv
  2734.  
  2735.   if {"[info commands $xfMenu]" != ""} {
  2736.     if {![info exists tk_popupPriv($xfMenu,focus)]} {
  2737.       set tk_popupPriv($xfMenu,focus) [focus]
  2738.     } {
  2739.       if {"$tk_popupPriv($xfMenu,focus)" == ""} {
  2740.         set tk_popupPriv($xfMenu,focus) [focus]
  2741.       }
  2742.     }
  2743.     set tk_popupPriv($xfMenu,grab) $xfMenu
  2744.  
  2745.     catch "$xfMenu activate none"
  2746.     catch "$xfMenu post $xfX $xfY"
  2747.     catch "focus $xfMenu"
  2748.     catch "grab -global $xfMenu"
  2749.   }
  2750. }
  2751. }
  2752.  
  2753.  
  2754. # Procedure: MenuPopupRelease
  2755. if {"[info procs MenuPopupRelease]" == ""} {
  2756. proc MenuPopupRelease { xfMenu xfW} {
  2757. # xf ignore me 7
  2758. ##########
  2759. # Procedure: MenuPopupRelease
  2760. # Description: remove the popup menu
  2761. # Arguments: xfMenu - the topmost menu widget
  2762. #            xfW - the menu widget
  2763. # Returns: none
  2764. # Sideeffects: none
  2765. ##########
  2766.   global tk_popupPriv
  2767.   global tkVersion
  2768.  
  2769.   if {"[info commands $xfW]" != "" && [winfo ismapped $xfW] &&
  2770.       "[winfo class $xfW]" == "Menu" &&
  2771.       [info exists tk_popupPriv($xfMenu,focus)] &&
  2772.       "$tk_popupPriv($xfMenu,focus)" != "" &&
  2773.       [info exists tk_popupPriv($xfMenu,grab)] &&
  2774.       "$tk_popupPriv($xfMenu,grab)" != ""} {
  2775.     if {$tkVersion >= 3.0} {
  2776.       catch "grab release $tk_popupPriv($xfMenu,grab)"
  2777.     } {
  2778.       catch "grab none"
  2779.     }
  2780.     catch "focus $tk_popupPriv($xfMenu,focus)"
  2781.     set tk_popupPriv($xfMenu,focus) ""
  2782.     set tk_popupPriv($xfMenu,grab) ""
  2783.     if {"[$xfW index active]" != "none"} {
  2784.       $xfW invoke active; catch "$xfMenu unpost"
  2785.     }
  2786.   }
  2787.   catch "$xfMenu unpost"
  2788. }
  2789. }
  2790.  
  2791.  
  2792. # Procedure: NoFunction
  2793. if {"[info procs NoFunction]" == ""} {
  2794. proc NoFunction { args} {
  2795. # xf ignore me 7
  2796. ##########
  2797. # Procedure: NoFunction
  2798. # Description: do nothing (especially with scales and scrollbars)
  2799. # Arguments: args - a number of ignored parameters
  2800. # Returns: none
  2801. # Sideeffects: none
  2802. ##########
  2803. }
  2804. }
  2805.  
  2806.  
  2807. # Procedure: SN
  2808. if {"[info procs SN]" == ""} {
  2809. proc SN { {xfName ""}} {
  2810. # xf ignore me 7
  2811. ##########
  2812. # Procedure: SN
  2813. # Description: map a symbolic name to the widget path
  2814. # Arguments: xfName
  2815. # Returns: the symbolic name
  2816. # Sideeffects: none
  2817. ##########
  2818.  
  2819.   SymbolicName $xfName
  2820. }
  2821. }
  2822.  
  2823.  
  2824. # Procedure: SymbolicName
  2825. if {"[info procs SymbolicName]" == ""} {
  2826. proc SymbolicName { {xfName ""}} {
  2827. # xf ignore me 7
  2828. ##########
  2829. # Procedure: SymbolicName
  2830. # Description: map a symbolic name to the widget path
  2831. # Arguments: xfName
  2832. # Returns: the symbolic name
  2833. # Sideeffects: none
  2834. ##########
  2835.  
  2836.   global symbolicName
  2837.  
  2838.   if {"$xfName" != ""} {
  2839.     set xfArrayName ""
  2840.     append xfArrayName symbolicName ( $xfName )
  2841.     if {![catch "set \"$xfArrayName\"" xfValue]} {
  2842.       return $xfValue
  2843.     } {
  2844.       if {"[info commands XFProcError]" != ""} {
  2845.         XFProcError "Unknown symbolic name:\n$xfName"
  2846.       } {
  2847.         puts stderr "XF error: unknown symbolic name:\n$xfName"
  2848.       }
  2849.     }
  2850.   }
  2851.   return ""
  2852. }
  2853. }
  2854.  
  2855.  
  2856. # Procedure: Unalias
  2857. if {"[info procs Unalias]" == ""} {
  2858. proc Unalias { aliasName} {
  2859. # xf ignore me 7
  2860. ##########
  2861. # Procedure: Unalias
  2862. # Description: remove an alias for a procedure
  2863. # Arguments: aliasName - the alias name to remove
  2864. # Returns: none
  2865. # Sideeffects: internalAliasList is updated, and the alias
  2866. #              proc is removed
  2867. ##########
  2868.   global internalAliasList
  2869.  
  2870.   set xfIndex [lsearch $internalAliasList "$aliasName *"]
  2871.   if {$xfIndex != -1} {
  2872.     rename $aliasName ""
  2873.     set internalAliasList [lreplace $internalAliasList $xfIndex $xfIndex]
  2874.   }
  2875. }
  2876. }
  2877.  
  2878.  
  2879.  
  2880. # application parsing procedure
  2881. proc XFLocalParseAppDefs {xfAppDefFile} {
  2882.   global xfAppDefaults
  2883.  
  2884.   # basically from: Michael Moore
  2885.   if {[file exists $xfAppDefFile] &&
  2886.       [file readable $xfAppDefFile] &&
  2887.       "[file type $xfAppDefFile]" == "link"} {
  2888.     catch "file type $xfAppDefFile" xfType
  2889.     while {"$xfType" == "link"} {
  2890.       if {[catch "file readlink $xfAppDefFile" xfAppDefFile]} {
  2891.         return
  2892.       }
  2893.       catch "file type $xfAppDefFile" xfType
  2894.     }
  2895.   }
  2896.   if {!("$xfAppDefFile" != "" &&
  2897.         [file exists $xfAppDefFile] &&
  2898.         [file readable $xfAppDefFile] &&
  2899.         "[file type $xfAppDefFile]" == "file")} {
  2900.     return
  2901.   }
  2902.   if {![catch "open $xfAppDefFile r" xfResult]} {
  2903.     set xfAppFileContents [read $xfResult]
  2904.     close $xfResult
  2905.     foreach line [split $xfAppFileContents "\n"] {
  2906.       # backup indicates how far to backup.  It applies to the
  2907.       # situation where a resource name ends in . and when it
  2908.       # ends in *.  In the second case you want to keep the *
  2909.       # in the widget name for pattern matching, but you want
  2910.       # to get rid of the . if it is the end of the name. 
  2911.       set backup -2  
  2912.       set line [string trim $line]
  2913.       if {[string index $line 0] == "#" || "$line" == ""} {
  2914.         # skip comments and empty lines
  2915.         continue
  2916.       }
  2917.       set list [split $line ":"]
  2918.       set resource [string trim [lindex $list 0]]
  2919.       set i [string last "." $resource]
  2920.       set j [string last "*" $resource]
  2921.       if {$j > $i} { 
  2922.         set i $j
  2923.         set backup -1
  2924.       }
  2925.       incr i
  2926.       set name [string range $resource $i end]
  2927.       incr i $backup
  2928.       set widname [string range $resource 0 $i]
  2929.       set value [string trim [lindex $list 1]]
  2930.       if {"$widname" != "" && "$widname" != "*"} {
  2931.         # insert the widget and resourcename to the application
  2932.         # defaults list.
  2933.         if {![info exists xfAppDefaults]} {
  2934.           set xfAppDefaults ""
  2935.         }
  2936.         lappend xfAppDefaults [list $widname [string tolower $name] $value]
  2937.       }
  2938.     }
  2939.   }
  2940. }
  2941.  
  2942. # application loading procedure
  2943. proc XFLocalLoadAppDefs {{xfClasses ""} {xfPriority "startupFile"} {xfAppDefFile ""}} {
  2944.   global env
  2945.  
  2946.   if {"$xfAppDefFile" == ""} {
  2947.     set xfFileList ""
  2948.     if {[info exists env(XUSERFILESEARCHPATH)]} {
  2949.       append xfFileList [split $env(XUSERFILESEARCHPATH) :]
  2950.     }
  2951.     if {[info exists env(XAPPLRESDIR)]} {
  2952.       append xfFileList [split $env(XAPPLRESDIR) :]
  2953.     }
  2954.     if {[info exists env(XFILESEARCHPATH)]} {
  2955.       append xfFileList [split $env(XFILESEARCHPATH) :]
  2956.     }
  2957.     append xfFileList " /usr/lib/X11/app-defaults"
  2958.     append xfFileList " /usr/X11/lib/X11/app-defaults"
  2959.  
  2960.     foreach xfCounter1 $xfClasses {
  2961.       foreach xfCounter2 $xfFileList {
  2962.         set xfPathName $xfCounter2
  2963.         if {[regsub -all "%N" "$xfPathName" "$xfCounter1" xfResult]} {
  2964.           set xfPathName $xfResult
  2965.         }
  2966.         if {[regsub -all "%T" "$xfPathName" "app-defaults" xfResult]} {
  2967.           set xfPathName $xfResult
  2968.         }
  2969.         if {[regsub -all "%S" "$xfPathName" "" xfResult]} {
  2970.           set xfPathName $xfResult
  2971.         }
  2972.         if {[regsub -all "%C" "$xfPathName" "" xfResult]} {
  2973.           set xfPathName $xfResult
  2974.         }
  2975.         if {[file exists $xfPathName] &&
  2976.             [file readable $xfPathName] &&
  2977.             ("[file type $xfPathName]" == "file" ||
  2978.              "[file type $xfPathName]" == "link")} {
  2979.           catch "option readfile $xfPathName $xfPriority"
  2980.           if {"[info commands XFParseAppDefs]" != ""} {
  2981.             XFParseAppDefs $xfPathName
  2982.           } {
  2983.             if {"[info commands XFLocalParseAppDefs]" != ""} {
  2984.               XFLocalParseAppDefs $xfPathName
  2985.             }
  2986.           }
  2987.         } {
  2988.           if {[file exists $xfCounter2/$xfCounter1] &&
  2989.               [file readable $xfCounter2/$xfCounter1] &&
  2990.               ("[file type $xfCounter2/$xfCounter1]" == "file" ||
  2991.                "[file type $xfCounter2/$xfCounter1]" == "link")} {
  2992.             catch "option readfile $xfCounter2/$xfCounter1 $xfPriority"
  2993.             if {"[info commands XFParseAppDefs]" != ""} {
  2994.               XFParseAppDefs $xfCounter2/$xfCounter1
  2995.             } {
  2996.               if {"[info commands XFLocalParseAppDefs]" != ""} {
  2997.                 XFLocalParseAppDefs $xfCounter2/$xfCounter1
  2998.               }
  2999.             }
  3000.           }
  3001.         }
  3002.       }
  3003.     }
  3004.   } {
  3005.     # load a specific application defaults file
  3006.     if {[file exists $xfAppDefFile] &&
  3007.         [file readable $xfAppDefFile] &&
  3008.         ("[file type $xfAppDefFile]" == "file" ||
  3009.          "[file type $xfAppDefFile]" == "link")} {
  3010.       catch "option readfile $xfAppDefFile $xfPriority"
  3011.       if {"[info commands XFParseAppDefs]" != ""} {
  3012.         XFParseAppDefs $xfAppDefFile
  3013.       } {
  3014.         if {"[info commands XFLocalParseAppDefs]" != ""} {
  3015.           XFLocalParseAppDefs $xfAppDefFile
  3016.         }
  3017.       }
  3018.     }
  3019.   }
  3020. }
  3021.  
  3022. # application setting procedure
  3023. proc XFLocalSetAppDefs {{xfWidgetPath "."}} {
  3024.   global xfAppDefaults
  3025.  
  3026.   if {![info exists xfAppDefaults]} {
  3027.     return
  3028.   }
  3029.   foreach xfCounter $xfAppDefaults {
  3030.     if {"$xfCounter" == ""} {
  3031.       break
  3032.     }
  3033.     set widname [lindex $xfCounter 0]
  3034.     if {[string match $widname ${xfWidgetPath}] ||
  3035.         [string match "${xfWidgetPath}*" $widname]} {
  3036.       set name [string tolower [lindex $xfCounter 1]]
  3037.       set value [lindex $xfCounter 2]
  3038.       # Now lets see how many tcl commands match the name
  3039.       # pattern specified.
  3040.       set widlist [info command $widname]
  3041.       if {"$widlist" != ""} {
  3042.         foreach widget $widlist {
  3043.           # make sure this command is a widget.
  3044.           if {![catch "winfo id $widget"] &&
  3045.               [string match "${xfWidgetPath}*" $widget]} {
  3046.             catch "$widget configure -$name $value" 
  3047.           }
  3048.         }
  3049.       }
  3050.     }
  3051.   }
  3052. }
  3053.  
  3054.  
  3055. # prepare auto loading
  3056. global auto_path
  3057. global tk_library
  3058. global xfLoadPath
  3059. foreach xfElement [eval list [split $xfLoadPath :] $auto_path] {
  3060.   if {[file exists $xfElement/tclIndex]} {
  3061.     lappend auto_path $xfElement
  3062.   }
  3063. }
  3064. catch "unset auto_index"
  3065.  
  3066. catch "unset auto_oldpath"
  3067.  
  3068. catch "unset auto_execs"
  3069.  
  3070.  
  3071. # initialize global variables
  3072. proc InitGlobals {} {
  3073.   global {argfilename}
  3074.   set {argfilename} {/etc/tbackup/new.arg}
  3075.   global {choosemethod}
  3076.   set {choosemethod} {set}
  3077.   global {fileselect_cancel}
  3078.   set {fileselect_cancel} {.fileSelectWindow.bframe.cancel}
  3079.   global {fileselect_dirlabel}
  3080.   set {fileselect_dirlabel} {.fileSelectWindow.file.dirlabel}
  3081.   global {fileselect_entry}
  3082.   set {fileselect_entry} {.fileSelectWindow.file.eframe.entry}
  3083.   global {fileselect_list}
  3084.   set {fileselect_list} {.fileSelectWindow.file.sframe.list}
  3085.   global {fileselect_ok}
  3086.   set {fileselect_ok} {.fileSelectWindow.bframe.okframe.ok}
  3087.   global {format}
  3088.   set {format} {0}
  3089.   global {formatalways}
  3090.   set {formatalways} {n}
  3091.   global {fsBox}
  3092.   set {fsBox(activeBackground)} {#bfbfbf}
  3093.   set {fsBox(activeForeground)} {}
  3094.   set {fsBox(all)} {1}
  3095.   set {fsBox(background)} {#bfbfbf}
  3096.   set {fsBox(button)} {0}
  3097.   set {fsBox(extensions)} {0}
  3098.   set {fsBox(font)} {}
  3099.   set {fsBox(foreground)} {}
  3100.   set {fsBox(internalPath)} {/etc/tbackup}
  3101.   set {fsBox(name)} {}
  3102.   set {fsBox(path)} {}
  3103.   set {fsBox(pattern)} {*.arg}
  3104.   set {fsBox(scrollActiveForeground)} {#bfbfbf}
  3105.   set {fsBox(scrollBackground)} {#bfbfbf}
  3106.   set {fsBox(scrollForeground)} {#bfbfbf}
  3107.   set {fsBox(scrollSide)} {right}
  3108.   set {fsBox(showPixmap)} {0}
  3109.   global {inputBox}
  3110.   set {inputBox(activeBackground)} {}
  3111.   set {inputBox(activeForeground)} {}
  3112.   set {inputBox(anchor)} {n}
  3113.   set {inputBox(background)} {}
  3114.   set {inputBox(erase)} {1}
  3115.   set {inputBox(font)} {}
  3116.   set {inputBox(foreground)} {}
  3117.   set {inputBox(justify)} {center}
  3118.   set {inputBox(scrollActiveForeground)} {}
  3119.   set {inputBox(scrollBackground)} {}
  3120.   set {inputBox(scrollForeground)} {}
  3121.   set {inputBox(scrollSide)} {left}
  3122.   set {inputBox(toplevelName)} {.inputBox}
  3123.   global {level}
  3124.   set {level} {f}
  3125.   global {mdens}
  3126.   set {mdens} {d}
  3127.   global {mnr}
  3128.   set {mnr} {0}
  3129.   global {packmethod}
  3130.   set {packmethod} {afio}
  3131.   global {readBox}
  3132.   set {readBox(activeBackground)} {}
  3133.   set {readBox(activeForeground)} {}
  3134.   set {readBox(background)} {}
  3135.   set {readBox(font)} {}
  3136.   set {readBox(foreground)} {}
  3137.   set {readBox(scrollActiveForeground)} {}
  3138.   set {readBox(scrollBackground)} {}
  3139.   set {readBox(scrollForeground)} {}
  3140.   set {readBox(scrollSide)} {left}
  3141.   global {result}
  3142.   set {result} {7}
  3143.   global {select}
  3144.   set {select} {text doesn't contain any characters tagged with "sel"}
  3145.   global {selection}
  3146.   set {selection} {{ system -- root filesystem, without /root dir.}}
  3147.   global {setfiled}
  3148.   set {setfiled} {/tmp/.tktbackup.set}
  3149.   global {setnameselection}
  3150.   set {setnameselection} {{ system -- root filesystem, without /root dir. }}
  3151.   global {temp}
  3152.   set {temp} {}
  3153.   global {textBox}
  3154.   set {textBox(activeBackground)} {#bfbfbf}
  3155.   set {textBox(activeForeground)} {black}
  3156.   set {textBox(background)} {#bfbfbf}
  3157.   set {textBox(button)} {0}
  3158.   set {textBox(contents)} {tktbackup by jonM<><
  3159. jonboy@neuromancer.ucr.edu
  3160. http://indyunix.iupui.edu/~jmmadiso/tktbackup.html}
  3161.   set {textBox(font)} {}
  3162.   set {textBox(foreground)} {}
  3163.   set {textBox(scrollActiveForeground)} {#bfbfbf}
  3164.   set {textBox(scrollBackground)} {#bfbfbf}
  3165.   set {textBox(scrollForeground)} {#bfbfbf}
  3166.   set {textBox(scrollSide)} {right}
  3167.   set {textBox(state)} {disabled}
  3168.   set {textBox(toplevelName)} {.textBox}
  3169.   global {verify_after_write}
  3170.   set {verify_after_write} {0}
  3171.   global {verify_format}
  3172.   set {verify_format} {n}
  3173.   global {verifyformat}
  3174.   set {verifyformat} {n}
  3175.   global {verifywrite}
  3176.   set {verifywrite} {n}
  3177.   global {writemethod}
  3178.   set {writemethod} {floppy}
  3179.   global {xh}
  3180.   set {xh} {}
  3181.  
  3182.   # please don't modify the following
  3183.   # variables. They are needed by xf.
  3184.   global {autoLoadList}
  3185.   set {autoLoadList(tktbackup.xf)} {0}
  3186.   global {internalAliasList}
  3187.   set {internalAliasList} {}
  3188.   global {moduleList}
  3189.   set {moduleList(tktbackup.xf)} {}
  3190.   global {preloadList}
  3191.   set {preloadList(xfInternal)} {}
  3192.   global {symbolicName}
  3193.   set {symbolicName(About)} {.topmenubar.menubutton2.m}
  3194.   set {symbolicName(About Box)} {.top0}
  3195.   set {symbolicName(Helpmenubutton)} {.topmenubar.menubutton2}
  3196.   set {symbolicName(OKbutton)} {.top0.button1}
  3197.   set {symbolicName(TkTbackupRootroot)} {.}
  3198.   set {symbolicName(UseBackupSetList)} {.chooseMethodFrame.frame.listbox1}
  3199.   set {symbolicName(aboutmenubutton)} {.topmenubar.menubutton1.m}
  3200.   set {symbolicName(backItUp)} {.topmenubar.actionmenu.m}
  3201.   set {symbolicName(choosesetbox)} {.top1.frame}
  3202.   set {symbolicName(horizontalscrollforlistbox)} {.scrollbar1}
  3203.   set {symbolicName(nulldescript)} {.writeMethodFrame.message2}
  3204.   set {symbolicName(one)} {.chooseMethodFrame.chooseMethodButtonsFrame.one}
  3205.   set {symbolicName(pack_descriptions)} {.packMethodsFrame.text0}
  3206.   set {symbolicName(root)} {.}
  3207.   set {symbolicName(setchooserlistbox)} {.chooseMethodFrame.frame1.listbox0}
  3208.   set {symbolicName(setfilelistbox)} {.chooseMethodFrame.frame}
  3209.   set {symbolicName(setnamelist)} {.chooseMethodFrame.frame1}
  3210.   global {xfWmSetPosition}
  3211.   set {xfWmSetPosition} {.top0 .aboutBox .filedescriptionwindow}
  3212.   global {xfWmSetSize}
  3213.   set {xfWmSetSize} {. .top0 .top1 .aboutBox .filedescriptionwindow}
  3214.   global {xfAppDefToplevels}
  3215.   set {xfAppDefToplevels} {}
  3216. }
  3217.  
  3218. # initialize global variables
  3219. InitGlobals
  3220.  
  3221. # display/remove toplevel windows.
  3222. ShowWindow.
  3223.  
  3224. global xfShowWindow.aboutBox
  3225. set xfShowWindow.aboutBox 0
  3226.  
  3227. global xfShowWindow.filedescriptionwindow
  3228. set xfShowWindow.filedescriptionwindow 0
  3229.  
  3230. # load default bindings.
  3231. if {[info exists env(XF_BIND_FILE)] &&
  3232.     "[info procs XFShowHelp]" == ""} {
  3233.   source $env(XF_BIND_FILE)
  3234. }
  3235.  
  3236. # parse and apply application defaults.
  3237. XFLocalLoadAppDefs Tktbackup
  3238. XFLocalSetAppDefs
  3239.  
  3240. # eof
  3241. #
  3242.  
  3243.